-
Notifications
You must be signed in to change notification settings - Fork 7
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
Smr 1935 erc20 withdraw l1 #18
Conversation
…to smr-1935-erc20-withdraw-L1
…vm-bridge-contracts into smr-1914-data-length-32
function test_RevertsIf_WithdrawWithInvalidSourceAddress() public { | ||
bytes memory data = abi.encode(WITHDRAW_SIG, address(token), address(this), address(this), withdrawAmount); | ||
|
||
bytes32 commandId = bytes32("testCommandId"); | ||
string memory sourceAddress = rootBridge.childBridgeAdaptor(); | ||
|
||
vm.expectRevert(InvalidSourceChain.selector); | ||
axelarAdaptor.execute(commandId, "INVALID", sourceAddress, data); | ||
} | ||
|
||
function test_RevertsIf_WithdrawWithInvalidSourceChain() public { | ||
bytes memory data = abi.encode(WITHDRAW_SIG, address(token), address(this), address(this), withdrawAmount); | ||
|
||
bytes32 commandId = bytes32("testCommandId"); | ||
string memory sourceAddress = Strings.toHexString(address(123)); | ||
|
||
vm.expectRevert(InvalidSourceAddress.selector); | ||
axelarAdaptor.execute(commandId, CHILD_CHAIN_NAME, sourceAddress, data); | ||
} |
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.
are these two tests, swapped? the test...InvalidSourceAddress
test seems to test for invalid source chain id, and the test...InvalidSourceChain
test for invalid source address
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.
yes they are. Good catch thanks
src/root/RootAxelarBridgeAdaptor.sol
Outdated
@@ -79,7 +77,17 @@ contract RootAxelarBridgeAdaptor is | |||
address(this), _childChain, _childBridgeAdaptor, payload, refundRecipient | |||
); | |||
|
|||
axelarGateway.callContract(_childChain, _childBridgeAdaptor, payload); | |||
gateway.callContract(_childChain, _childBridgeAdaptor, payload); | |||
emit AxelarMessage(_childChain, _childBridgeAdaptor, payload); |
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.
nit:
- for better observability, should we have a corresponding event when a message is received (in
_execute()
)? - suggest we rename
AxelarMessage
toAxelarMessageSent
so its a bit more descriptive
[SMR-1914] data length must be greater than 32
Co-authored-by: Ermyas Abebe <[email protected]>
…vm-bridge-contracts into smr-1935-erc20-withdraw-L1
The L1 side of ERC20 Withdrawals.
Blocked by #16