Conversation
dkent600
left a comment
There was a problem hiding this comment.
Why is this contract name prefixed with "dxDao"? Does it have no possible more widespread use?
| // solhint-disable-next-line not-rely-on-time | ||
| require(releaseTime < now, "cannot withdraw before releaseTime"); | ||
| // solhint-disable-next-line avoid-call-value | ||
| (bool success, ) = owner.call.value(address(this).balance)(""); |
There was a problem hiding this comment.
Why not msg.sender.transfer(address(this).balance) ?
There was a problem hiding this comment.
because transfer is limited in gas. it might work for dxdao avatar though no promise for other contracts which consume gas on the fallback function.
https://diligence.consensys.net/blog/2019/09/stop-using-soliditys-transfer-now/
| public | ||
| returns(bool success, bytes memory returnValue) { | ||
| // solhint-disable-next-line avoid-low-level-calls | ||
| (success, returnValue) = _contract.call(_encodedABI); |
There was a problem hiding this comment.
Why instead of sending the _encodeABI we execute the withdraw function with the signature that we already know it will have?
(success, returnValue) = _contract.call(abi.encodeWithSignature("withdraw()"));
Doing this we make sure that the ONLY function that can be executed is the withdraw()
There was a problem hiding this comment.
It is a public generic function which can call any contract specific Abis.
this is just a test helper contract and is not part of any dao.
yeah, right? I guess the idea is to have this feature to all DAOs.. |
I am not sure yet . We might have it specific to dxdao by hard coded its address and release time.though might complicate the tests. |
No description provided.