-
Notifications
You must be signed in to change notification settings - Fork 96
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
dex/networks/eth: ETH fidelity bonds contract #2717
base: master
Are you sure you want to change the base?
Conversation
This diff introduces the solidity contract that supports posting fidelity bonds on ETH.
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.
These tests are really cool. We need them for the current contracts.
// bonds, the difference will be refunded to the sender, but only if the | ||
// locktimes of the bonds to be refunded has passed. | ||
function updateBonds(bytes32 acctID, Bond[] calldata oldBonds, Bond[] calldata newBonds, uint index) external payable senderIsOrigin() { | ||
emit BondUpdated(acctID, index, oldBonds, newBonds); |
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.
I'm still reading up on how emit works, but is it ok at the beginning? Does it never happen if the tx fails?
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.
Yeah, no log if the tx fails.
// a mapping(bytes32 => bytes32) with only one commitment, but this | ||
// would allow a troublemaker to post a bond blocking the actual | ||
// account owner from doing so. | ||
mapping(bytes32 => bytes32[]) public bondCommits; |
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.
Can we get all of the values and locktimes upon restoration from seed?
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, you just check the latest log for the account ID. Actually the log should be updated to include the msg.sender
.
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.
Awesome! We can't do that with the utxo bonds yet.
This diff introduces the solidity contract that supports posting fidelity bonds on ETH.