Skip to content

Commit 497c9d7

Browse files
committed
cli: actual uint64 max for initial outbound limit
1 parent 41cea69 commit 497c9d7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

evm/script/DeployWormholeNtt.s.sol

+15-1
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,23 @@ contract DeployWormholeNtt is Script, DeployWormholeNttBase {
2626
console.log("Deploying Wormhole Ntt...");
2727
IWormhole wh = IWormhole(wormhole);
2828

29+
(bool success, bytes memory queriedDecimals) =
30+
token.staticcall(abi.encodeWithSignature("decimals()"));
31+
32+
if (!success) {
33+
console.log("Failed to query token decimals");
34+
vm.stopBroadcast();
35+
return;
36+
}
37+
38+
uint8 decimals = abi.decode(queriedDecimals, (uint8));
39+
2940
uint16 chainId = wh.chainId();
3041

3142
console.log("Chain ID: ", chainId);
3243

44+
uint256 scale = decimals > TRIMMED_DECIMALS ? uint256(10 ** (decimals - TRIMMED_DECIMALS)) : 1;
45+
3346
DeploymentParams memory params = DeploymentParams({
3447
token: token,
3548
mode: mode,
@@ -41,7 +54,8 @@ contract DeployWormholeNtt is Script, DeployWormholeNttBase {
4154
specialRelayerAddr: specialRelayer,
4255
consistencyLevel: 202,
4356
gasLimit: 500000,
44-
outboundLimit: uint256(type(uint64).max) * 10 ** 10
57+
// the trimming will trim this number to uint64.max
58+
outboundLimit: uint256(type(uint64).max) * scale
4559
});
4660

4761
// Deploy NttManager.

0 commit comments

Comments
 (0)