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

feat: propose() function #11

Merged
merged 7 commits into from
May 16, 2024
Merged

feat: propose() function #11

merged 7 commits into from
May 16, 2024

Conversation

ARR4N
Copy link
Owner

@ARR4N ARR4N commented May 15, 2024

From propose() comment:

    /**
     * @notice "Announces" a propsed swap (in the form of a `Proposal` event), using the last block's hash as the salt
     * for the predicted swapper address.
     * @dev This is an optional step and swaps will function without prior proposal, but users SHOULD use this function
     * as it provides two security benefits: (i) a trusted means by which to safely determine the address they need to
     * approve to transfer their assets; and (ii) increasing the security level of the swapper address from 80 to 160
     * bits.
     * @dev A salt known to an adversary reduces the security of the swapper address to that of collision resistance
     * (~80 bits) whereas an unknown salt relies on second pre-image resistance (full address space = 160 bits). Using
     * the last block's hash would require computing a collision in the inter-block period (12s) so is sufficient.
     * @dev This function MAY be called on a different chain to the one on which the swap will occur, provided that the
     * deployer contract has the same address.
     */

ARR4N added 6 commits May 14, 2024 11:44
… + invert order of swap/salt in event

The order of swap then salt in the broadcast event now matches the calls to `fill()` and `cancel()`. In theory
(i.e not tested) this means that the logged `data` can be used as a call once prepended with the correct
selector.
@ARR4N ARR4N changed the title feat: broadcast() function feat: propose() function May 16, 2024
@ARR4N ARR4N merged commit 0e2f5b2 into main May 16, 2024
1 check passed
@ARR4N ARR4N deleted the arr4n/broadcast branch May 16, 2024 13:42
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.

1 participant