Skip to content

Commit

Permalink
Fix batch inbox calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog committed Oct 1, 2024
1 parent 2eba93e commit eacbbbf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/DeployChain.sol
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,15 @@ contract DeployChain {
}

function calculateBatchInbox(uint256 chainID) public pure returns (address) {
uint256 inbox = 0;
uint256 reverse = 0;
for (; chainID > 0; chainID /= 10) {
inbox = (inbox << 4) | (chainID % 10);
reverse = (reverse * 10) + (chainID % 10);
}
return address(uint160(inbox | (0xff << 152)));
uint256 base16 = 0;
for (; reverse > 0; reverse /= 10) {
base16 = (base16 << 4) | (reverse % 10);
}
return address(uint160(base16 | (0xff << 152)));
}

function setupProxies(uint256 chainID) internal returns (DeployAddresses memory) {
Expand Down

0 comments on commit eacbbbf

Please sign in to comment.