-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: batch request contract for fetching multiple token balance #36
Conversation
ZKS-75 L1 TVL
Create a Batch contract to query token balances from Get the top 30 list of token addresses and tickers by USD holdings on shared bridge from etherscan. Measure how many token balance request can be made until fail or revert.
and validate boundaries BridgeHub address: 0x303a465B659cBB0ab36eE643eA362c509EEb5213 SharedBridge address: 0xD7f9f54194C633F36CCD5F3da84ad4a1c38cB2cB AC:
|
contracts/test/TokenBalances.t.sol
Outdated
// We're using vm.etch to place the creation code at a deterministic address. | ||
vm.etch(_deploymentAddress, creationCode); | ||
|
||
// simulate deployment | ||
(bool success, bytes memory result) = _deploymentAddress.call(""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, didn't know this trick!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Claude-AI gave me a hand jaja 😅
contracts/test/TokenBalances.t.sol
Outdated
vm.mockCall(address(_tokenA), abi.encodeWithSelector(IERC20.balanceOf.selector), abi.encode(_initialBalanceA)); | ||
vm.mockCall(address(_tokenB), abi.encodeWithSelector(IERC20.balanceOf.selector), abi.encode(_initialBalanceB)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to mock here right?
contracts/test/TokenBalances.t.sol
Outdated
tokenAddresses[0] = address(_tokenA); | ||
tokenAddresses[1] = address(_tokenB); | ||
|
||
bytes memory creationCode = getBytecode(_target, tokenAddresses); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's another one like this..
bytes memory creationCode = getBytecode(_target, tokenAddresses); | |
bytes memory creationCode = _getBytecode(_target, tokenAddresses); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
ZKS-138 Batch Contract implementation
Create a Batch contract to query token balances from Use Foundry for testing the contract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh some Solidity action over here 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
🤖 Linear
Closes ZKS-138
Description