Skip to content

Conversation

@ScreamingHawk
Copy link
Contributor

Currently, the 0WithdrawControlled interface allows an address with the WITHDRAW_ROLE to withdraw to any address. This new WithdrawOnlyTo contract is intended to sit between and ensure that withdraws can only happen to a given address. We can use this in conjunction with the PaymentSplitter to require withdraws of primary sales that are always split accurately between recipients.

sequenceDiagram
    actor User
    participant WithdrawOnlyTo
    participant ERCXXXSale
    participant PaymentSplitter

    User->>WithdrawOnlyTo: withdrawETH(from, value)
    WithdrawOnlyTo->>ERCXXXSale: withdrawETH(to: paymentSplitterAddr, value)
    ERCXXXSale-->>PaymentSplitter: send ETH
    User->>PaymentSplitter: release(account)
Loading
classDiagram
    class WithdrawOnlyTo {
        - address withdrawTo
        +withdrawETH(from: address, value: uint256)
    }

    class ERCXXXSale {
        +withdrawETH(to: address, value: uint256)
    }

    class PaymentSplitter {
        +release(account: address)
        <<Service>>
    }

    WithdrawOnlyTo --> PaymentSplitter : withdrawTo is
    WithdrawOnlyTo --> ERCXXXSale : calls
    ERCXXXSale --> WithdrawOnlyTo : has WITHDRAW_ROLE
    ERCXXXSale --> PaymentSplitter : sends ETH to

Loading

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.

2 participants