Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
OUSDResolutionUpgrade
Compiler Version
v0.8.7+commit.e28d00a7
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-11-01 */ contract OUSDResolutionUpgrade { enum RebaseOptions { NotSet, OptOut, OptIn } // From Initializable bool private initialized; bool private initializing; uint256[50] private ______igap; // From InitializableERC20Detailed uint256[100] private _____ugap; string private _name; string private _symbol; uint8 private _decimals; // From OUSD uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1 uint256 public _totalSupply; mapping(address => mapping(address => uint256)) private _allowances; address public vaultAddress = address(0); mapping(address => uint256) private _creditBalances; uint256 private _rebasingCredits; uint256 private _rebasingCreditsPerToken; uint256 public nonRebasingSupply; mapping(address => uint256) public nonRebasingCreditsPerToken; mapping(address => RebaseOptions) public rebaseState; mapping(address => uint256) public isUpgraded; uint256 private constant RESOLUTION_INCREASE = 1e9; /** * @return High resolution rebasingCreditsPerToken */ function rebasingCreditsPerToken() public view returns (uint256) { return _rebasingCreditsPerToken / RESOLUTION_INCREASE; } /** * @return High resolution total number of rebasing credits */ function rebasingCredits() public view returns (uint256) { return _rebasingCredits / RESOLUTION_INCREASE; } /** * @return High resolution rebasingCreditsPerToken */ function rebasingCreditsPerTokenHighres() public view returns (uint256) { return _rebasingCreditsPerToken; } /** * @return High resolution total number of rebasing credits */ function rebasingCreditsHighres() public view returns (uint256) { return _rebasingCredits; } function upgradeGlobals() external { require(isUpgraded[address(0)] == 0, "Globals already upgraded"); require(_rebasingCredits > 0, "Sanity _rebasingCredits"); require( _rebasingCreditsPerToken > 0, "Sanity _rebasingCreditsPerToken" ); isUpgraded[address(0)] = 1; _rebasingCredits = _rebasingCredits * RESOLUTION_INCREASE; _rebasingCreditsPerToken = _rebasingCreditsPerToken * RESOLUTION_INCREASE; } function upgradeAccounts(address[] calldata accounts) external { for (uint256 i = 0; i < accounts.length; i++) { address account = accounts[i]; require(account != address(0), "Reserved"); require(isUpgraded[account] == 0, "Account already upgraded"); isUpgraded[account] = 1; // Handle special for non-rebasing accounts uint256 nrc = nonRebasingCreditsPerToken[account]; if (nrc > 0) { require(nrc < 1e18, "Account already highres"); nonRebasingCreditsPerToken[account] = nrc * RESOLUTION_INCREASE; } // Upgrade balance uint256 balance = _creditBalances[account]; require(balance > 0, "Will not upgrade zero balance"); _creditBalances[account] = balance * RESOLUTION_INCREASE; } } function creditsBalanceOfHighres(address _account) public view returns ( uint256, uint256, bool ) { return ( _creditBalances[_account], _creditsPerToken(_account), isUpgraded[_account] == 1 ); } /** * @dev Get the credits per token for an account. Returns a fixed amount * if the account is non-rebasing. * @param _account Address of the account. */ function _creditsPerToken(address _account) internal view returns (uint256) { if (nonRebasingCreditsPerToken[_account] != 0) { return nonRebasingCreditsPerToken[_account]; } else { return _rebasingCreditsPerToken; } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"name":"_totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"creditsBalanceOfHighres","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isUpgraded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonRebasingCreditsPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonRebasingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rebaseState","outputs":[{"internalType":"enum OUSDResolutionUpgrade.RebaseOptions","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebasingCredits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebasingCreditsHighres","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebasingCreditsPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebasingCreditsPerTokenHighres","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"}],"name":"upgradeAccounts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upgradeGlobals","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vaultAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6080604052609c80546001600160a01b031916905534801561002057600080fd5b506107f8806100306000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80636691cb3d1161008c57806395ef84b91161006657806395ef84b914610195578063e5c4fffe146101b5578063e696393a146101e5578063eec037f6146101ee57600080fd5b80636691cb3d1461017d5780637a46a9c5146101855780637d0d66ff1461018d57600080fd5b8063077f22b7146100d45780633eaaf86b146100ef578063430bf08a146100f8578063456ee2861461012357806351cfd6fe14610153578063609350cd1461015d575b600080fd5b6100dc610201565b6040519081526020015b60405180910390f35b6100dc609a5481565b609c5461010b906001600160a01b031681565b6040516001600160a01b0390911681526020016100e6565b61014661013136600461066d565b60a26020526000908152604090205460ff1681565b6040516100e69190610712565b61015b61021a565b005b6100dc61016b36600461066d565b60a16020526000908152604090205481565b6100dc610394565b609f546100dc565b609e546100dc565b6100dc6101a336600461066d565b60a36020526000908152604090205481565b6101c86101c336600461066d565b6103a8565b6040805193845260208401929092521515908201526060016100e6565b6100dc60a05481565b61015b6101fc36600461069d565b6103f7565b6000633b9aca00609e54610215919061073a565b905090565b6000805260a36020527f69b4e8f94ad9e612080e13aad01219472d8c2c7ae7aa6cdf175400ddc8c4ed3d54156102975760405162461bcd60e51b815260206004820152601860248201527f476c6f62616c7320616c7265616479207570677261646564000000000000000060448201526064015b60405180910390fd5b6000609e54116102e95760405162461bcd60e51b815260206004820152601760248201527f53616e697479205f7265626173696e6743726564697473000000000000000000604482015260640161028e565b6000609f541161033b5760405162461bcd60e51b815260206004820152601f60248201527f53616e697479205f7265626173696e6743726564697473506572546f6b656e00604482015260640161028e565b6000805260a360205260017f69b4e8f94ad9e612080e13aad01219472d8c2c7ae7aa6cdf175400ddc8c4ed3d55609e5461037a90633b9aca009061075c565b609e55609f5461038f90633b9aca009061075c565b609f55565b6000633b9aca00609f54610215919061073a565b6001600160a01b0381166000908152609d6020526040812054819081906103ce8561062b565b6001600160a01b0395909516600090815260a36020526040902054909560019091149350915050565b60005b81811015610626576000838383818110610416576104166107ac565b905060200201602081019061042b919061066d565b90506001600160a01b03811661046e5760405162461bcd60e51b815260206004820152600860248201526714995cd95c9d995960c21b604482015260640161028e565b6001600160a01b038116600090815260a36020526040902054156104d45760405162461bcd60e51b815260206004820152601860248201527f4163636f756e7420616c72656164792075706772616465640000000000000000604482015260640161028e565b6001600160a01b038116600090815260a3602090815260408083206001905560a1909152902054801561058057670de0b6b3a764000081106105585760405162461bcd60e51b815260206004820152601760248201527f4163636f756e7420616c72656164792068696768726573000000000000000000604482015260640161028e565b610566633b9aca008261075c565b6001600160a01b038316600090815260a160205260409020555b6001600160a01b0382166000908152609d6020526040902054806105e65760405162461bcd60e51b815260206004820152601d60248201527f57696c6c206e6f742075706772616465207a65726f2062616c616e6365000000604482015260640161028e565b6105f4633b9aca008261075c565b6001600160a01b039093166000908152609d60205260409020929092555081905061061e8161077b565b9150506103fa565b505050565b6001600160a01b038116600090815260a160205260408120541561066557506001600160a01b0316600090815260a1602052604090205490565b5050609f5490565b60006020828403121561067f57600080fd5b81356001600160a01b038116811461069657600080fd5b9392505050565b600080602083850312156106b057600080fd5b823567ffffffffffffffff808211156106c857600080fd5b818501915085601f8301126106dc57600080fd5b8135818111156106eb57600080fd5b8660208260051b850101111561070057600080fd5b60209290920196919550909350505050565b602081016003831061073457634e487b7160e01b600052602160045260246000fd5b91905290565b60008261075757634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561077657610776610796565b500290565b600060001982141561078f5761078f610796565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea2646970667358221220b702652b8e84ebe1dd98b51bbdb1b38e3f38e7168c0ced64be478385cd6651c464736f6c63430008070033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80636691cb3d1161008c57806395ef84b91161006657806395ef84b914610195578063e5c4fffe146101b5578063e696393a146101e5578063eec037f6146101ee57600080fd5b80636691cb3d1461017d5780637a46a9c5146101855780637d0d66ff1461018d57600080fd5b8063077f22b7146100d45780633eaaf86b146100ef578063430bf08a146100f8578063456ee2861461012357806351cfd6fe14610153578063609350cd1461015d575b600080fd5b6100dc610201565b6040519081526020015b60405180910390f35b6100dc609a5481565b609c5461010b906001600160a01b031681565b6040516001600160a01b0390911681526020016100e6565b61014661013136600461066d565b60a26020526000908152604090205460ff1681565b6040516100e69190610712565b61015b61021a565b005b6100dc61016b36600461066d565b60a16020526000908152604090205481565b6100dc610394565b609f546100dc565b609e546100dc565b6100dc6101a336600461066d565b60a36020526000908152604090205481565b6101c86101c336600461066d565b6103a8565b6040805193845260208401929092521515908201526060016100e6565b6100dc60a05481565b61015b6101fc36600461069d565b6103f7565b6000633b9aca00609e54610215919061073a565b905090565b6000805260a36020527f69b4e8f94ad9e612080e13aad01219472d8c2c7ae7aa6cdf175400ddc8c4ed3d54156102975760405162461bcd60e51b815260206004820152601860248201527f476c6f62616c7320616c7265616479207570677261646564000000000000000060448201526064015b60405180910390fd5b6000609e54116102e95760405162461bcd60e51b815260206004820152601760248201527f53616e697479205f7265626173696e6743726564697473000000000000000000604482015260640161028e565b6000609f541161033b5760405162461bcd60e51b815260206004820152601f60248201527f53616e697479205f7265626173696e6743726564697473506572546f6b656e00604482015260640161028e565b6000805260a360205260017f69b4e8f94ad9e612080e13aad01219472d8c2c7ae7aa6cdf175400ddc8c4ed3d55609e5461037a90633b9aca009061075c565b609e55609f5461038f90633b9aca009061075c565b609f55565b6000633b9aca00609f54610215919061073a565b6001600160a01b0381166000908152609d6020526040812054819081906103ce8561062b565b6001600160a01b0395909516600090815260a36020526040902054909560019091149350915050565b60005b81811015610626576000838383818110610416576104166107ac565b905060200201602081019061042b919061066d565b90506001600160a01b03811661046e5760405162461bcd60e51b815260206004820152600860248201526714995cd95c9d995960c21b604482015260640161028e565b6001600160a01b038116600090815260a36020526040902054156104d45760405162461bcd60e51b815260206004820152601860248201527f4163636f756e7420616c72656164792075706772616465640000000000000000604482015260640161028e565b6001600160a01b038116600090815260a3602090815260408083206001905560a1909152902054801561058057670de0b6b3a764000081106105585760405162461bcd60e51b815260206004820152601760248201527f4163636f756e7420616c72656164792068696768726573000000000000000000604482015260640161028e565b610566633b9aca008261075c565b6001600160a01b038316600090815260a160205260409020555b6001600160a01b0382166000908152609d6020526040902054806105e65760405162461bcd60e51b815260206004820152601d60248201527f57696c6c206e6f742075706772616465207a65726f2062616c616e6365000000604482015260640161028e565b6105f4633b9aca008261075c565b6001600160a01b039093166000908152609d60205260409020929092555081905061061e8161077b565b9150506103fa565b505050565b6001600160a01b038116600090815260a160205260408120541561066557506001600160a01b0316600090815260a1602052604090205490565b5050609f5490565b60006020828403121561067f57600080fd5b81356001600160a01b038116811461069657600080fd5b9392505050565b600080602083850312156106b057600080fd5b823567ffffffffffffffff808211156106c857600080fd5b818501915085601f8301126106dc57600080fd5b8135818111156106eb57600080fd5b8660208260051b850101111561070057600080fd5b60209290920196919550909350505050565b602081016003831061073457634e487b7160e01b600052602160045260246000fd5b91905290565b60008261075757634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561077657610776610796565b500290565b600060001982141561078f5761078f610796565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea2646970667358221220b702652b8e84ebe1dd98b51bbdb1b38e3f38e7168c0ced64be478385cd6651c464736f6c63430008070033
Deployed Bytecode Sourcemap
0:4189:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1385:121;;;:::i;:::-;;;4091:25:1;;;4079:2;4064:18;1385:121:0;;;;;;;;505:27;;;;;;613:40;;;;;-1:-1:-1;;;;;613:40:0;;;;;;-1:-1:-1;;;;;1089:32:1;;;1071:51;;1059:2;1044:18;613:40:0;925:203:1;911:52:0;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;:::i;1915:520::-;;;:::i;:::-;;843:61;;;;;;:::i;:::-;;;;;;;;;;;;;;1157:137;;;:::i;1588:122::-;1678:24;;1588:122;;1801:106;1883:16;;1801:106;;970:45;;;;;;:::i;:::-;;;;;;;;;;;;;;3346:336;;;;;;:::i;:::-;;:::i;:::-;;;;4323:25:1;;;4379:2;4364:18;;4357:34;;;;4434:14;4427:22;4407:18;;;4400:50;4311:2;4296:18;3346:336:0;4127:329:1;804:32:0;;;;;;2443:895;;;;;;:::i;:::-;;:::i;1385:121::-;1433:7;1071:3;1460:16;;:38;;;;:::i;:::-;1453:45;;1385:121;:::o;1915:520::-;1969:22;;;:10;:22;;;;:27;1961:64;;;;-1:-1:-1;;;1961:64:0;;1683:2:1;1961:64:0;;;1665:21:1;1722:2;1702:18;;;1695:30;1761:26;1741:18;;;1734:54;1805:18;;1961:64:0;;;;;;;;;2063:1;2044:16;;:20;2036:56;;;;-1:-1:-1;;;2036:56:0;;2746:2:1;2036:56:0;;;2728:21:1;2785:2;2765:18;;;2758:30;2824:25;2804:18;;;2797:53;2867:18;;2036:56:0;2544:347:1;2036:56:0;2152:1;2125:24;;:28;2103:109;;;;-1:-1:-1;;;2103:109:0;;3434:2:1;2103:109:0;;;3416:21:1;3473:2;3453:18;;;3446:30;3512:33;3492:18;;;3485:61;3563:18;;2103:109:0;3232:355:1;2103:109:0;2223:22;;;:10;:22;;2248:1;2223:22;:26;2279:16;;:38;;1071:3;;2279:38;:::i;:::-;2260:16;:57;2368:24;;:59;;1071:3;;2368:59;:::i;:::-;2328:24;:99;1915:520::o;1157:137::-;1213:7;1071:3;1240:24;;:46;;;;:::i;3346:336::-;-1:-1:-1;;;;;3557:25:0;;3459:7;3557:25;;;:15;:25;;;;;;3459:7;;;;3597:26;3573:8;3597:16;:26::i;:::-;-1:-1:-1;;;;;3638:20:0;;;;;;;;:10;:20;;;;;;3535:139;;3662:1;3638:25;;;;-1:-1:-1;3346:336:0;-1:-1:-1;;3346:336:0:o;2443:895::-;2522:9;2517:814;2537:19;;;2517:814;;;2578:15;2596:8;;2605:1;2596:11;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;2578:29;-1:-1:-1;;;;;;2630:21:0;;2622:42;;;;-1:-1:-1;;;2622:42:0;;3098:2:1;2622:42:0;;;3080:21:1;3137:1;3117:18;;;3110:29;-1:-1:-1;;;3155:18:1;;;3148:38;3203:18;;2622:42:0;2896:331:1;2622:42:0;-1:-1:-1;;;;;2687:19:0;;;;;;:10;:19;;;;;;:24;2679:61;;;;-1:-1:-1;;;2679:61:0;;3794:2:1;2679:61:0;;;3776:21:1;3833:2;3813:18;;;3806:30;3872:26;3852:18;;;3845:54;3916:18;;2679:61:0;3592:348:1;2679:61:0;-1:-1:-1;;;;;2755:19:0;;;;;;:10;:19;;;;;;;;2777:1;2755:23;;2866:26;:35;;;;;;2920:7;;2916:176;;2962:4;2956:3;:10;2948:46;;;;-1:-1:-1;;;2948:46:0;;2036:2:1;2948:46:0;;;2018:21:1;2075:2;2055:18;;;2048:30;2114:25;2094:18;;;2087:53;2157:18;;2948:46:0;1834:347:1;2948:46:0;3051:25;1071:3;3051;:25;:::i;:::-;-1:-1:-1;;;;;3013:35:0;;;;;;:26;:35;;;;;:63;2916:176;-1:-1:-1;;;;;3156:24:0;;3138:15;3156:24;;;:15;:24;;;;;;3203:11;3195:53;;;;-1:-1:-1;;;3195:53:0;;2388:2:1;3195:53:0;;;2370:21:1;2427:2;2407:18;;;2400:30;2466:31;2446:18;;;2439:59;2515:18;;3195:53:0;2186:353:1;3195:53:0;3290:29;1071:3;3290:7;:29;:::i;:::-;-1:-1:-1;;;;;3263:24:0;;;;;;;:15;:24;;;;;:56;;;;-1:-1:-1;2558:3:0;;-1:-1:-1;2558:3:0;;;:::i;:::-;;;;2517:814;;;;2443:895;;:::o;3879:307::-;-1:-1:-1;;;;;4002:36:0;;3973:7;4002:36;;;:26;:36;;;;;;:41;3998:181;;-1:-1:-1;;;;;;4067:36:0;;;;;:26;:36;;;;;;;3879:307::o;3998:181::-;-1:-1:-1;;4143:24:0;;;3879:307::o;14:286:1:-;73:6;126:2;114:9;105:7;101:23;97:32;94:52;;;142:1;139;132:12;94:52;168:23;;-1:-1:-1;;;;;220:31:1;;210:42;;200:70;;266:1;263;256:12;200:70;289:5;14:286;-1:-1:-1;;;14:286:1:o;305:615::-;391:6;399;452:2;440:9;431:7;427:23;423:32;420:52;;;468:1;465;458:12;420:52;508:9;495:23;537:18;578:2;570:6;567:14;564:34;;;594:1;591;584:12;564:34;632:6;621:9;617:22;607:32;;677:7;670:4;666:2;662:13;658:27;648:55;;699:1;696;689:12;648:55;739:2;726:16;765:2;757:6;754:14;751:34;;;781:1;778;771:12;751:34;834:7;829:2;819:6;816:1;812:14;808:2;804:23;800:32;797:45;794:65;;;855:1;852;845:12;794:65;886:2;878:11;;;;;908:6;;-1:-1:-1;305:615:1;;-1:-1:-1;;;;305:615:1:o;1133:343::-;1280:2;1265:18;;1313:1;1302:13;;1292:144;;1358:10;1353:3;1349:20;1346:1;1339:31;1393:4;1390:1;1383:15;1421:4;1418:1;1411:15;1292:144;1445:25;;;1133:343;:::o;4461:217::-;4501:1;4527;4517:132;;4571:10;4566:3;4562:20;4559:1;4552:31;4606:4;4603:1;4596:15;4634:4;4631:1;4624:15;4517:132;-1:-1:-1;4663:9:1;;4461:217::o;4683:168::-;4723:7;4789:1;4785;4781:6;4777:14;4774:1;4771:21;4766:1;4759:9;4752:17;4748:45;4745:71;;;4796:18;;:::i;:::-;-1:-1:-1;4836:9:1;;4683:168::o;4856:135::-;4895:3;-1:-1:-1;;4916:17:1;;4913:43;;;4936:18;;:::i;:::-;-1:-1:-1;4983:1:1;4972:13;;4856:135::o;4996:127::-;5057:10;5052:3;5048:20;5045:1;5038:31;5088:4;5085:1;5078:15;5112:4;5109:1;5102:15;5128:127;5189:10;5184:3;5180:20;5177:1;5170:31;5220:4;5217:1;5210:15;5244:4;5241:1;5234:15
Swarm Source
ipfs://b702652b8e84ebe1dd98b51bbdb1b38e3f38e7168c0ced64be478385cd6651c4
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.