Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Use a pull model to withdraw deposit ETH balances #570

Merged
merged 14 commits into from Apr 10, 2020

Commits on Apr 9, 2020

  1. Implement withdrawal fundctions

    enableWithdrawal - Enables a given address to withdraw value
    after the contract reaches an end state
    
    withdrawFunds - Withdraw the funds a given caller is allowed.
    Only callable after the contract has reached an end-state.
    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    c3883da View commit details
    Browse the repository at this point in the history
  2. Use withdrawal functions

    Use the pull model instead of
    forwarding value directly.
    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    f64f0e8 View commit details
    Browse the repository at this point in the history
  3. add getWithdrawAllowance method

    Allow for withdrawable-allowance querry.
    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    0a6083a View commit details
    Browse the repository at this point in the history
  4. move auctionValue() to TestDeposit()

    We use this in liquidation tests now,
    it is still inherited for use where TestDepositUtils is used
    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    2e362fb View commit details
    Browse the repository at this point in the history
  5. Test withdraw methods

    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    5ee7544 View commit details
    Browse the repository at this point in the history
  6. Update remaining tests to check for pullable value

    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    90b082e View commit details
    Browse the repository at this point in the history
  7. typo and convention fix

    contact -> contract
    _valueToDistribute -> valueToDistribute
    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    3da16e5 View commit details
    Browse the repository at this point in the history
  8. fix conditional value check.

    check `contractEthBalance > valueToDistribute + 1`
    to avoid spliting a balance of 1 wei.
    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    41ebf22 View commit details
    Browse the repository at this point in the history
  9. Improve docs

    more consistent naming, remove awkward possessive
    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    a83cf15 View commit details
    Browse the repository at this point in the history
  10. check Deposit balances allong with allowances

    Check that the contract has what it owes
    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    4e3011e View commit details
    Browse the repository at this point in the history
  11. Assert initial balance is empty

    For better test safety make sure the initial balance is not
    influences by other factors
    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    08b1a7d View commit details
    Browse the repository at this point in the history
  12. Check every state for withdraw eligibility

    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    4d2160d View commit details
    Browse the repository at this point in the history
  13. Account for gas cost and check exact value

    Checking that the final balance is greated than the initial one does
    not prove that the withdraw() functions correctly.
    Instead, account for gas cost
    and check the exact value.
    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    f16e591 View commit details
    Browse the repository at this point in the history
  14. @notice -> @dev for struct mappings

    Users will not be directly interacting,
    therefore  @dev is more appropreate
    NicholasDotSol committed Apr 9, 2020
    Configuration menu
    Copy the full SHA
    a281cce View commit details
    Browse the repository at this point in the history