Skip to content

Make OUSD EIP-7702 compatible and simplify yield delegation process. #2543

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion contracts/contracts/token/OUSD.sol
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ contract OUSD is Governable {
* @param _account Address of the account.
*/
function _autoMigrate(address _account) internal {
bool isContract = _account.code.length > 0;
bool isContract = _account.code.length > 0 &&
bytes3(_account.code) != 0xef0100;
// In previous code versions, contracts would not have had their
// rebaseState[_account] set to RebaseOptions.NonRebasing when migrated
// therefore we check the actual accounting used on the account instead.
Expand Down
34 changes: 34 additions & 0 deletions contracts/deploy/mainnet/143_ousd_upgrade_EIP7702.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const { deploymentWithGovernanceProposal } = require("../../utils/deploy");

module.exports = deploymentWithGovernanceProposal(
{
deployName: "143_ousd_upgrade_EIP7702",
forceDeploy: false,
//forceSkip: true,
reduceQueueTime: true,
deployerIsProposer: false,
proposalId: "",
},
async ({ deployWithConfirmation }) => {
// Deployer Actions
// ----------------

// 1. Deploy new OUSD implementation without storage slot checks
const dOUSD = await deployWithConfirmation("OUSD", [], "OUSD", true);
const cOUSDProxy = await ethers.getContract("OUSDProxy");

// Governance Actions
// ----------------
return {
name: "Upgrade OUSD token contract",
actions: [
// 1. Upgrade the OUSD proxy to the new implementation
{
contract: cOUSDProxy,
signature: "upgradeTo(address)",
args: [dOUSD.address],
},
],
};
}
);