Closed cryshado closed 3 months ago
Hey can you try set a gasLimit
in your tx? Something like this: {gasLimit: "10000000" }
. Also what's the address of the token you trying to register? Would like to see if I can replicate this error myself, thanks!
@benjamin852 thank you for the reply. Just for the test I was trying to use a simple ERC20 smart contract:
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract MyToken is ERC20, Ownable {
constructor()
ERC20("MyToken", "MTK")
Ownable(msg.sender)
{
_mint(msg.sender, 10_000_000 * 10 ** 18);
}
}
And I just deployed this ERC20 to Filecoin Calibration testnet:
0x35290AFD33E8F26b00FfC8a4383d7332b8d9e4C8
And then I'm getting the same error when calling registerCanonicalInterchainToken
. By the way, I tried reproducing the same steps in Sepolia Testnet (Ethereum) and everything seems to work, so the problem doesn't look like a gas limit issue.
Which environment are you running from? I tried to run the exact same code as you (on both sepolia and calibration) and it worked fine on both chains for me.
@benjamin852 this code gives me an error:
interface ITokenFactory {
function registerCanonicalInterchainToken(address tokenAddress) external payable returns (bytes32 tokenId);
}
contract Helper {
address public constant _interchainTokenFactory = address(0x83a93500d23Fbc3e82B410aD07A6a9F7A0670D66);
bytes32 public _tokenId;
constructor() {
address token = address(0x35290AFD33E8F26b00FfC8a4383d7332b8d9e4C8);
_tokenId = ITokenFactory(_interchainTokenFactory).registerCanonicalInterchainToken(token);
}
}
Okay I was able to replicate now. There seems to be a problem with your token at address 0x35290AFD33E8F26b00FfC8a4383d7332b8d9e4C8
. It works fine for me when I deploy a fresh token and pass in the address of that new token instead of 0x35290AFD33E8F26b00FfC8a4383d7332b8d9e4C8
in your constructor
.
Also when I try to interact with the token at address 0x35290AFD33E8F26b00FfC8a4383d7332b8d9e4C8
on it's own I am unable to query a symbol
or name
for it so not really sure what's going on with that token. Easiest fix I think is just to use a new token and then it should work fine for you.
@benjamin852 looks a little bit weird, now I can see the same - some of the functions on this ERC20 isn't callable. But I've tried to use the same ERC20 contract on other networks and it works fine. It might be something like Filecoin + ERC20 openzeppelin implementation specific issues. I will try to investigate it. Thank you for the feedback!
UPD: Wiped everything out of Remix, tried it in a new environment, everything seems to be working. Strange... but ok :)
Hi! I'm trying to call
registerCanonicalInterchainToken
on theInterchainTokenFactory
contract, that is deployed on the Filecoin mainnet. I'm using this address, that I was found in the documentation:During this call:
I'm getting an error:
I tried making the same call with the Solidity contract and got the same error:
What could be the cause of the problem?