Closed shahthepro closed 6 months ago
We wish to provide one transaction + approval of OGV and veOGV stakes to OGN and xOGN stakes.
This contract collects ogv to the user's address, and then burns it there using an approval. OGN is then sent to a new stake for the user's address and/or sent directly to the user.
A simple migrate method can just burn and transfers without touching the staking system.
No crypto
selfdestruct
delegatecall
outside of proxying. If an implementation contract were to call delegatecall under attacker control, it could call selfdestruct the implementation contract, leading to calls through the proxy silently succeeding, even though they were failing.Deploy file not yet written
Logic looks correct.
No deploy yet
This code will hold and then distribute 40%ish of the circulating supply of OGN. An exploit could have major financial consequences for token holders.
Although OGV is the current governance token and xOGN will be the future governance token, this migration contract should not be able to directly cause a loss of governance, since during the migration period, a multisig will temporary control governance.
We will be topping off the code with excess OGN tokens, since we don't know precisely when the migration will start. If the deployer still had governance, they could skim off excess tokens. We plan to move tokens to this contract and start() it from the same governance transaction, which means the governance action would fail if the migration contract was not owned by governance.
A concern would be if a user could take OGV tokens from someone else. This does not appear to be possible since all funds pulls are from msg.sender.
Another concern would be getting too many tokens for a conversion. The conversion rate matches the governance proposal. We will have another sanity check in that the amount of OGN initially transferred to the contract will be checked. Finally, the isSolvent modifier should revert if we give out too many tokens.
Flavor is good.
no crypto
selfdestruct
delegatecall
outside of proxying. If an implementation contract were to call delegatecall under attacker control, it could call selfdestruct the implementation contract, leading to calls through the proxy silently succeeding, even though they were failing.No deploy code written
When deploy code is written, a collect call should be made just before this upgrade.
Logic appears correct.
This contract holds 3.7 billion OGV, which will soon be convertible to OGN - 40 something million at today's prices.
An attack would attempt to gain access to another user's tokens, get more tokens than owed, or double withdraw.
The code is slightly awkward because of the tension between keeping backwards compatibility versus most functionality no longer being needed. However there is not any anticipated future work on this contract, and it's okay as is.
Noting that we should do some fork testing of this during the audit.
If you made a contract change, make sure to complete the checklist below before merging it in master.
Contract change checklist: