-
Notifications
You must be signed in to change notification settings - Fork 21
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
Internal audit feedback #1 - Nithin #117
Comments
It's a workaround for this issue OpenZeppelin/openzeppelin-contracts#2402 Not as important now that we use different access control for vaults - will update to use OpenZeppelin. #119
Here are some implementations in production: Here is the OpenZeppelin implementation:
Ah - I actually deprecated that file but forgot to delete. Using the OpenZeppelin implementation instead:
Don't think the nonce will get high enough :) |
swapped to using OpenZeppelin template in #120 |
|
https://github.com/ampleforth/token-geyser-v2/blob/main/contracts/UniversalVault.sol#L81 |
|
|
or something like that .. https://github.com/ampleforth/token-geyser-v2/blob/main/contracts/Geyser.sol#L418 |
I went back and forth on this - while it seems more convenient to pick up the gas at runtime it brings in concerns about it being changed on the fly by the geyser. Scenario: Geyser gets hacked and attacker increases gas stipend to > block gas limit to make sure no one can ragequit |
I've avoided putting natspec comments on getters since they are usually more confusing than reading the code itself and seriously bloats the size of the file. I could mention the restrictions in inline comments though. |
Makes sense 👍 Maybe add a comment in the Geyser's rage quit function implementation about this gas limit restriction. |
Did you reimplement open zeppelin's libraries because of an incompatible solidity version?
If so can we just use the solidity version which is compatible with open zeppelin's latest release?
https://github.com/ampleforth/token-geyser-v2/blob/main/contracts/Access/Ownable.sol
Is there a standard/audited implementation for ERC-1271 which we can reference
https://github.com/ampleforth/token-geyser-v2/blob/main/contracts/Access/ERC1271.sol
I'm not really sure about the difference but, rather than using assembly to make the external call here we can just use
to.value(value).gas(gas).call(data)
?https://github.com/ampleforth/token-geyser-v2/blob/main/contracts/ExternalCall/ExternalCall.sol#L55
"If the gas is 0 we assume that nearly all available gas can be used"
https://github.com/ampleforth/token-geyser-v2/blob/main/contracts/ExternalCall/ExternalCall.sol#L40
Shouldn't the condition here be:
gas == 0 ? gas : (gasleft() - 2500)
Is there a test for the above condition? https://github.com/ampleforth/token-geyser-v2/blob/main/test/ExternalCall/ExternalCall.ts
return success? https://github.com/ampleforth/token-geyser-v2/blob/main/contracts/ExternalCall/ExternalCall.sol#L46
Safemath? https://github.com/ampleforth/token-geyser-v2/blob/main/contracts/UniversalVault.sol#L252
The text was updated successfully, but these errors were encountered: