-
Notifications
You must be signed in to change notification settings - Fork 27
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
crosschain calls #241
base: master
Are you sure you want to change the base?
crosschain calls #241
Conversation
CoderZhi
commented
Mar 14, 2024
- Add payload to cashier
- Call receivers in validator with payload
@@ -0,0 +1,135 @@ | |||
pragma solidity <6.0 >=0.4.24; |
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.
is this based on contracts/iotube/TransferValidator.sol? Why not contracts/iotube/TransferValidatorV2.sol instead?
uint256 fee = msg.value; | ||
if (_token == address(0)) { | ||
require(msg.value >= _amount, "insufficient msg.value"); | ||
fee = msg.value - _amount; |
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.
should check decimal overflow or use solidity 0.8 above
} | ||
witnesses[i] = witness; | ||
} | ||
require(numOfSignatures * 3 > witnessList.numOfActive() * 2, "insufficient witnesses"); |
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.
Move L58 to above of L49 can be more efficiently when insufficient witnesses occur
for (uint256 it = 0; it < tokenLists.length; it++) { | ||
if (tokenLists[it].isAllowed(tokenAddr)) { | ||
uint256 numOfSignatures = signatures.length / 65; | ||
address[] memory witnesses = new address[](numOfSignatures); |
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.
more readable to keep inside extractWitnesses()
|
||
function depositTo(address _token, address _to, uint256 _amount, bytes calldata _payload) public whenNotPaused payable { | ||
require(_to != address(0), "invalid destination"); | ||
// require(_payload.length == 0 || contractDestinations[_to], "invalid destination with 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.
how is contractDestinations used?