artgenexyz / webflow-nft-components

Connect web3 to Webflow without coding skills

Home Page:https://buildship.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error adding CONTRACT_ABI: Custom code is over 10000 character limit

justinsteu opened this issue · comments

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.

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 */ ]
}