Closed VoR0220 closed 6 months ago
It would appear that this is also somewhat related to #116 because as I can see when I try to run that example script it fails right at the same step which would be right here:
The unpredictable gas limit can be further traced to a revert in the EVM which no doubt is due to the proxy issue above. So...how does this get fixed?
Hey can you try set a gasLimit
when deploying the token Manager? I had a similar issue which I solved by passing in a gasLimit
for the tx
Hey @benjamin852 thanks for the quick response!
I did try overriding the gas limit and while the unpredictable gas limit error is gone, the revert in the contracts remains. It would appear that there have been some not so insignificant changes to the ITS contracts since April when the guide for custom linking was written and this could possibly be factoring in? If you could perhaps explain to me what is exactly supposed to be happening with that proxy deployment where it calls setup in the constructor that I linked earlier, I think we may be able to more easily get to the bottom of this. Everything else in the ITS token deployment manager makes sense to me along the way until we get to this setup function which I'm not understanding what its exactly running? It's clearly trying to set up a proxy of some kind, but there doesn't appear to be a setup function defined?
Anyways, here's the error below:
Error: processing response error (body="{\"id\":53,\"jsonrpc\":\"2.0\",\"error\":{\"message\":\"VM Exception while processing transaction: revert\",\"stack\":\"RuntimeError: VM Exception while processing transaction: revert\\n at EIP1559FeeMarketTransaction.fillFromResult (/Users/rj/axelar-examples/node_modules/ganache/dist/node/1.js:2:234543)\\n at Miner.<anonymous> (/Users/rj/axelar-examples/node_modules/ganache/dist/node/1.js:2:174897)\\n at async Miner.<anonymous> (/Users/rj/axelar-examples/node_modules/ganache/dist/node/1.js:2:173310)\\n at async Miner.mine (/Users/rj/axelar-examples/node_modules/ganache/dist/node/1.js:2:177695)\\n at async Blockchain.mine (/Users/rj/axelar-examples/node_modules/ganache/dist/node/1.js:2:87561)\\n at async Promise.all (index 0)\\n at async TransactionPool.emit (/Users/rj/axelar-examples/node_modules/ganache/node_modules/emittery/index.js:303:3)\",\"code\":-32000,\"name\":\"RuntimeError\",\"data\":{\"hash\":\"0x8956b1db3ad7b6f57fce56be9d3fea3d1e1edc896cb9c1ec1ab30dfca965f141\",\"programCounter\":132,\"result\":\"0x8956b1db3ad7b6f57fce56be9d3fea3d1e1edc896cb9c1ec1ab30dfca965f141\",\"reason\":null,\"message\":\"revert\"}}}", error={"code":-32000,"data":{"hash":"0x8956b1db3ad7b6f57fce56be9d3fea3d1e1edc896cb9c1ec1ab30dfca965f141","programCounter":132,"result":"0x8956b1db3ad7b6f57fce56be9d3fea3d1e1edc896cb9c1ec1ab30dfca965f141","reason":null,"message":"revert"}}, requestBody="{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0x02f901d38209c6038459682f00845d22d79a830f424094c13323a75343432bc9c5db570532ecb9eb07f81280b9016498d78c82a457d6c043b7288454773321a440ba8866d47f96d924d4c38a50b2b0698fae4600000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000400000000000000000000000002f9682a17e2fb9b1545b711971b77a6e5d90ffe10000000000000000000000000000000000000000000000000000000000000014068ea5cd133662655657bcd6206398da72feed04000000000000000000000000c080a04f1286aefefbd22205434ef1e53de197a18dac206d3e9a88b42b4b37a29ff099a0133045fcca9746c5248189de549a682d84722d7fbb5a3a4dadf2c35aec6498cf\"],\"id\":53,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="http://localhost:8500/2", code=SERVER_ERROR, version=web/5.7.1)
at Logger.makeError (/Users/rj/axelar-examples/node_modules/@ethersproject/logger/lib/index.js:238:21)
at Logger.throwError (/Users/rj/axelar-examples/node_modules/@ethersproject/logger/lib/index.js:247:20)
at /Users/rj/axelar-examples/node_modules/@ethersproject/web/lib/index.js:313:32
at step (/Users/rj/axelar-examples/node_modules/@ethersproject/web/lib/index.js:33:23)
at Object.next (/Users/rj/axelar-examples/node_modules/@ethersproject/web/lib/index.js:14:53)
at fulfilled (/Users/rj/axelar-examples/node_modules/@ethersproject/web/lib/index.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
reason: 'processing response error',
code: 'SERVER_ERROR',
body: '{"id":53,"jsonrpc":"2.0","error":{"message":"VM Exception while processing transaction: revert","stack":"RuntimeError: VM Exception while processing transaction: revert\\n
at EIP1559FeeMarketTransaction.fillFromResult (/Users/rj/axelar-examples/node_modules/ganache/dist/node/1.js:2:234543)\\n at Miner.<anonymous> (/Users/rj/axelar-examples/node_modules/ganache/dist/node/1.js:2:174897)\\n at async Miner.<anonymous> (/Users/rj/axelar-examples/node_modules/ganache/dist/node/1.js:2:173310)\\n at async Miner.mine (/Users/rj/axelar-examples/node_modules/ganache/dist/node/1.js:2:177695)\\n at async Blockchain.mine (/Users/rj/axelar-examples/node_modules/ganache/dist/node/1.js:2:87561)\\n at async Promise.all (index 0)\\n
at async TransactionPool.emit (/Users/rj/axelar-examples/node_modules/ganache/node_modules/emittery/index.js:303:3)","code":-32000,"name":"RuntimeError","data":{"hash":"0x8956b1db3ad7b6f57fce56be9d3fea3d1e1edc896cb9c1ec1ab30dfca965f141","programCounter":132,"result":"0x8956b1db3ad7b6f57fce56be9d3fea3d1e1edc896cb9c1ec1ab30dfca965f141","reason":null,"message":"revert"}}}',
this is failing precisely at this line in the example script:
This is while using Node.js v18.20.3
Hey so just looking at this again a few things. Where is address(wave)
coming from? Don't see it defined. Also why are you passing .009
ether this last param should match the msg.value
being sent into the contract (0 in your case). The ownerAddress
which you pass in as well should be of type bytes
as the setup() function attempts to decode a bytes
type not address
type here.
Regarding your question though the setup()
in TokenManager is run to set roles such as flowLimiter
and operator
for the tokenManager. It's defined here
Oh my bad that address(wave)
is from me copying over and trying to change names and I lost that one in the process. Should be address(token)
. I have since also tried the above but the encoding it as a bytes doesn't seem to work. Could try encoding it from an env var but I'm running out of ideas for the bytes. The pointing out where the setup()
function exists does help though, now I'm wondering why this contract might not be deploying.
bytes memory ownerAddressBytes = abi.encode(ownerAddress);
bytes memory params = abi.encode(ownerAddressBytes, address(token));
console.logBytes(params);
bytes32 tokenId = tokenService.deployTokenManager(
salt,
"",
ITokenManagerType.TokenManagerType.MINT_BURN,
params,
0
);
The above reverts with InvalidBytesLength when trying to use the toAddress function in the AddressBytes.sol lib in axelar-gmp-sdk-solidity.
Update since I started writing this. I found the solution! The solution is to use abi.encodePacked(address ownerAddress) here and then encode that in the ABI. Its a tight packing solution that will get it past this step. Will ask questions in the discord if need further assistance. In the meantime, highly recommend an update of docs to make a note that if you're using foundry to use packed encoding to get past this step!
Example:
console.log("expected token manager address: ", tokenService.tokenManagerAddress(expectedTokenId));
bytes memory ownerAddressBytes = abi.encodePacked(ownerAddress);
bytes memory params = abi.encode(ownerAddressBytes, address(token));
console.logBytes(params);
tokenId = tokenService.deployTokenManager(
salt,
"",
ITokenManagerType.TokenManagerType.LOCK_UNLOCK,
params,
0
);
Hello! I'm currently trying to make a bridhge using the ITS Custom Linking setup. I've been following along with this guide to create general foundry setup off of a forked network of eth sepolia and base sepolia. Not expecting the cross interchain to work but I am expecting the dry runs to atleast work from a transaction perspective and not fail. This is not the case.
I've started off by deploying my tokens using create2 for deterministic addresses on both networks. This goes fine without a hitch. My token is not a mint/burn type so I've opted to go toward the LOCK_UNLOCK type Token Manager. I have encoded a salt. I have encoded my params argument for it as (address ownerAddress, address tokenAddress). I have given .009 ether amount of gas amount into the system, because better it be overkill than not enough.
Currently I am running into an issue where it fails on deploying the token manager, specifically at calling the setup function on IProxy in the constructor of the token manager itself:
https://github.com/axelarnetwork/interchain-token-service/blob/main/contracts/proxies/TokenManagerProxy.sol#L42
It would appear that it is reverting due to calling a contract that currently doesn't exist. I've scanned the codebase and tried to piece together how this logically is supposed to work but so far I am drawing a blank. Help me understand how this is supposed to work so that I can work to solve this?
For reference I am calling the function this way in foundry:
the token is constructed as such: