Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error adding CONTRACT_ABI: Custom code is over 10000 character limit #22

Closed
justinsteu opened this issue Feb 16, 2022 · 1 comment
Closed

Comments

@justinsteu
Copy link

I am having issues adding the contract ABI to the code. When I add it, the custom code is over the 10000 character limit for webflow. Is there any way to call the abi from an external source like a CDN? something like this?

<script src="https://cdn.jsdelivr.net/gh/user/repo@version/file"></script>

I tried to just add this code with the correct user/rep@version/file and the mint button is not connecting to the contract and just sends me to the metamask website to download metamask.

@caffeinum caffeinum changed the title Adding ABI Error adding CONTRACT_ABI: Custom code is over 10000 character limit Feb 17, 2022
@caffeinum
Copy link
Member

The possible solutions are:

  • remove unused parts in ABI (ABI is just an array of { ... }, you can safely remove events and onlyOwner methods, basically you only need mint, getPrice and totalSupply)
  • use DEFAULTS.abiCacheURL to return JSON in a format { [address]: [...abi...] }:

Example:

DEFAULTS = { abiCacheURL: "https://ipfs.io/ipfs/Qm...." }

which returns:

{
    "0xYourContractAddress": [  /* .... your ABI array goes here */ ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants