Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

crosschain calls #241

wants to merge 3 commits into from

Conversation

CoderZhi
Copy link
Collaborator

  1. Add payload to cashier
  2. Call receivers in validator with payload

@@ -0,0 +1,135 @@
pragma solidity <6.0 >=0.4.24;
Copy link
Contributor

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;
Copy link
Collaborator

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");
Copy link
Collaborator

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);
Copy link
Collaborator

@Liuhaai Liuhaai Mar 15, 2024

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");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is contractDestinations used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants