How can I make an erc20votes token an interchain token using axelar?

113 Views Asked by At

I’m trying to make a token interchain, my token is an erc20votes token

I tried deploying the ERC20votes contract through the interchain token portal, registered it on avalanche as the main chain, and deployed to the bnb chain as a remote chain, all the functions work fine on the main chain (avalanche) and I was able to send tokens crosschain from avalanche to bnb, but when I test the erc20votes contract on the bnb chain (remote chain) and try to call some functions on it that are not native to the IERC20 interface like delegate, the transaction fails and I get this error after debugging from remix

Returned error: {"jsonrpc":"2.0","error":"The method \"debug_traceTransaction\" does not exist / is not available.","id":7108126628519236}

How can I make the erc20votes token interchain so that I can call delegate and some other functions on the erc20votes contract on the remote chains?

I tried using the axelar interchain portal to make it interchain, I expected the call to go through, but the transaction reverts.

1

There are 1 best solutions below

0
On

To make your token available with all of your custom functionality on multiple chains, you'll want to register a custom TokenManager on each chain by calling this method on the Interchain Token Service (0xF786e21509A9D50a9aFD033B5940A2b7D872C208):

function deployCustomTokenManager(
    bytes32 salt,
    TokenManagerType tokenManagerType,
    bytes memory params
) public payable notPaused returns (bytes32 tokenId)

You'll need to give the token manager permissions to mint/burn or lock/release (on up to one chain). By sharing a caller address and a salt, the token ID should match across chains and your tokens should flow when you call the sending methods on the TokenManager.