openzeppelin-contracts
openzeppelin-contracts copied to clipboard
How to understand the code "vault.deposit.value(msg.value)(msg.sender);"
Hi, there
I don't understand why this code use ".value(x)" here. I know it's setting the ether value, but why use here?
Thanks, I'm very curious :)
Justin
That's a way of calling the RefundVault#deposit function, which is payable, with a specific msg.value amount.
See: https://ethereum.stackexchange.com/a/9722/3054
@maraoz how can I call Crowdsale's fallback(the payable method without name) function in another contract, say Presale.sol? Thanks.
@jacktang http://solidity.readthedocs.io/en/v0.4.21/units-and-global-variables.html?highlight=message%20call#address-related