diff --git a/.openzeppelin/mainnet-stDASH.json b/.openzeppelin/mainnet-stDASH.json new file mode 100644 index 0000000..f0b9f84 --- /dev/null +++ b/.openzeppelin/mainnet-stDASH.json @@ -0,0 +1,178 @@ +{ + "manifestVersion": "3.1", + "impls": { + "d4a9d30d775b980cf02533b51f3707a6911151e43596bd8fb695f5ed4d0f58ab": { + "address": "0x3c47ff4108B12ca539e6C0Bf1cC8Bd63f90B5394", + "txHash": "0xbff640854f323e21b946d49c9a62ebaa877e4dd5b6c03e2d159e897f8810b6ac", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "initialized", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:21" + }, + { + "contract": "Initializable", + "label": "initializing", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:26" + }, + { + "contract": "Initializable", + "label": "______gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:61" + }, + { + "contract": "ContextUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\GSN\\Context.sol:37" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:18" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:78" + }, + { + "contract": "PausableUpgradeSafe", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:26" + }, + { + "contract": "PausableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:84" + }, + { + "contract": "StakedToken", + "label": "supplyController", + "type": "t_address", + "src": "contracts\\StakedToken.sol:29" + }, + { + "contract": "StakedToken", + "label": "MAX_UINT256", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:31" + }, + { + "contract": "StakedToken", + "label": "_maxExpectedSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:34" + }, + { + "contract": "StakedToken", + "label": "_sharesPerToken", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:36" + }, + { + "contract": "StakedToken", + "label": "_totalSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:37" + }, + { + "contract": "StakedToken", + "label": "_totalShares", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:38" + }, + { + "contract": "StakedToken", + "label": "_shareBalances", + "type": "t_mapping(t_address,t_uint256)", + "src": "contracts\\StakedToken.sol:40" + }, + { + "contract": "StakedToken", + "label": "_allowedTokens", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts\\StakedToken.sol:42" + }, + { + "contract": "StakedToken", + "label": "_name", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:44" + }, + { + "contract": "StakedToken", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:45" + }, + { + "contract": "StakedToken", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts\\StakedToken.sol:46" + }, + { + "contract": "StakedToken", + "label": "isBlacklisted", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts\\StakedToken.sol:48" + }, + { + "contract": "StakedToken", + "label": "downstreamCaller", + "type": "t_contract(DownstreamCaller)986", + "src": "contracts\\StakedToken.sol:54" + } + ], + "types": { + "t_address": { + "label": "address" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(DownstreamCaller)986": { + "label": "contract DownstreamCaller" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + } + }, + "admin": { + "address": "0xbB20Fc67287a028bab7E6646c328E323444Be963", + "txHash": "0x28168ebfe58a4389321a65959ddf9e4ecea07617185c9c4d3f347f6b93b26461" + } +} diff --git a/.openzeppelin/mainnet-stDOT.json b/.openzeppelin/mainnet-stDOT.json new file mode 100644 index 0000000..81b950b --- /dev/null +++ b/.openzeppelin/mainnet-stDOT.json @@ -0,0 +1,178 @@ +{ + "manifestVersion": "3.1", + "impls": { + "d4a9d30d775b980cf02533b51f3707a6911151e43596bd8fb695f5ed4d0f58ab": { + "address": "0x507E11d64feA7601f717Ee86154B854239A642e4", + "txHash": "0x0c5c3bf66664e9a91b5aebc0449186609c8e72a810981cf3e33fd04df909cb96", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "initialized", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:21" + }, + { + "contract": "Initializable", + "label": "initializing", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:26" + }, + { + "contract": "Initializable", + "label": "______gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:61" + }, + { + "contract": "ContextUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\GSN\\Context.sol:37" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:18" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:78" + }, + { + "contract": "PausableUpgradeSafe", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:26" + }, + { + "contract": "PausableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:84" + }, + { + "contract": "StakedToken", + "label": "supplyController", + "type": "t_address", + "src": "contracts\\StakedToken.sol:29" + }, + { + "contract": "StakedToken", + "label": "MAX_UINT256", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:31" + }, + { + "contract": "StakedToken", + "label": "_maxExpectedSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:34" + }, + { + "contract": "StakedToken", + "label": "_sharesPerToken", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:36" + }, + { + "contract": "StakedToken", + "label": "_totalSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:37" + }, + { + "contract": "StakedToken", + "label": "_totalShares", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:38" + }, + { + "contract": "StakedToken", + "label": "_shareBalances", + "type": "t_mapping(t_address,t_uint256)", + "src": "contracts\\StakedToken.sol:40" + }, + { + "contract": "StakedToken", + "label": "_allowedTokens", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts\\StakedToken.sol:42" + }, + { + "contract": "StakedToken", + "label": "_name", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:44" + }, + { + "contract": "StakedToken", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:45" + }, + { + "contract": "StakedToken", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts\\StakedToken.sol:46" + }, + { + "contract": "StakedToken", + "label": "isBlacklisted", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts\\StakedToken.sol:48" + }, + { + "contract": "StakedToken", + "label": "downstreamCaller", + "type": "t_contract(DownstreamCaller)986", + "src": "contracts\\StakedToken.sol:54" + } + ], + "types": { + "t_address": { + "label": "address" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(DownstreamCaller)986": { + "label": "contract DownstreamCaller" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + } + }, + "admin": { + "address": "0x62E2e66Dde3b94dd1Eaf91BeA70EBcbe298B2D08", + "txHash": "0x6f1db58f47b5d6191d5946ad8087291e283ef3caa5c84b4ef43458edb4ec2eec" + } +} diff --git a/.openzeppelin/mainnet-stMATIC.json b/.openzeppelin/mainnet-stMATIC.json new file mode 100644 index 0000000..b840bf5 --- /dev/null +++ b/.openzeppelin/mainnet-stMATIC.json @@ -0,0 +1,178 @@ +{ + "manifestVersion": "3.1", + "impls": { + "d4a9d30d775b980cf02533b51f3707a6911151e43596bd8fb695f5ed4d0f58ab": { + "address": "0xFD330ec969E2194649305E617C0Cf434642bf62e ", + "txHash": "0x5040f1b81329b50cf3f6e6de4967be6b33397a355cbbf418c033c07641f1f9cb", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "initialized", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:21" + }, + { + "contract": "Initializable", + "label": "initializing", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:26" + }, + { + "contract": "Initializable", + "label": "______gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:61" + }, + { + "contract": "ContextUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\GSN\\Context.sol:37" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:18" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:78" + }, + { + "contract": "PausableUpgradeSafe", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:26" + }, + { + "contract": "PausableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:84" + }, + { + "contract": "StakedToken", + "label": "supplyController", + "type": "t_address", + "src": "contracts\\StakedToken.sol:29" + }, + { + "contract": "StakedToken", + "label": "MAX_UINT256", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:31" + }, + { + "contract": "StakedToken", + "label": "_maxExpectedSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:34" + }, + { + "contract": "StakedToken", + "label": "_sharesPerToken", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:36" + }, + { + "contract": "StakedToken", + "label": "_totalSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:37" + }, + { + "contract": "StakedToken", + "label": "_totalShares", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:38" + }, + { + "contract": "StakedToken", + "label": "_shareBalances", + "type": "t_mapping(t_address,t_uint256)", + "src": "contracts\\StakedToken.sol:40" + }, + { + "contract": "StakedToken", + "label": "_allowedTokens", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts\\StakedToken.sol:42" + }, + { + "contract": "StakedToken", + "label": "_name", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:44" + }, + { + "contract": "StakedToken", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:45" + }, + { + "contract": "StakedToken", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts\\StakedToken.sol:46" + }, + { + "contract": "StakedToken", + "label": "isBlacklisted", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts\\StakedToken.sol:48" + }, + { + "contract": "StakedToken", + "label": "downstreamCaller", + "type": "t_contract(DownstreamCaller)986", + "src": "contracts\\StakedToken.sol:54" + } + ], + "types": { + "t_address": { + "label": "address" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(DownstreamCaller)986": { + "label": "contract DownstreamCaller" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + } + }, + "admin": { + "address": "0xc0F2f2D3809fB55a92906830F9376E18a279316A", + "txHash": "0x2ac99dee65879f3a873932528c1aab64456199a3930765ffc49bf6207031d4f8" + } +} diff --git a/.openzeppelin/mainnet-stXYM.json b/.openzeppelin/mainnet-stXYM.json new file mode 100644 index 0000000..1da6558 --- /dev/null +++ b/.openzeppelin/mainnet-stXYM.json @@ -0,0 +1,178 @@ +{ + "manifestVersion": "3.1", + "impls": { + "d4a9d30d775b980cf02533b51f3707a6911151e43596bd8fb695f5ed4d0f58ab": { + "address": "0x794e630c1f27017e66d3Ee34c8D9156773F29d5e", + "txHash": "0x4c24a727c0a23f13db0e1d0f8c9aaf3238a4de7835d67074f8b12ab4dd38a5bb", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "initialized", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:21" + }, + { + "contract": "Initializable", + "label": "initializing", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:26" + }, + { + "contract": "Initializable", + "label": "______gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:61" + }, + { + "contract": "ContextUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\GSN\\Context.sol:37" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:18" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:78" + }, + { + "contract": "PausableUpgradeSafe", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:26" + }, + { + "contract": "PausableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:84" + }, + { + "contract": "StakedToken", + "label": "supplyController", + "type": "t_address", + "src": "contracts\\StakedToken.sol:29" + }, + { + "contract": "StakedToken", + "label": "MAX_UINT256", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:31" + }, + { + "contract": "StakedToken", + "label": "_maxExpectedSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:34" + }, + { + "contract": "StakedToken", + "label": "_sharesPerToken", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:36" + }, + { + "contract": "StakedToken", + "label": "_totalSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:37" + }, + { + "contract": "StakedToken", + "label": "_totalShares", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:38" + }, + { + "contract": "StakedToken", + "label": "_shareBalances", + "type": "t_mapping(t_address,t_uint256)", + "src": "contracts\\StakedToken.sol:40" + }, + { + "contract": "StakedToken", + "label": "_allowedTokens", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts\\StakedToken.sol:42" + }, + { + "contract": "StakedToken", + "label": "_name", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:44" + }, + { + "contract": "StakedToken", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:45" + }, + { + "contract": "StakedToken", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts\\StakedToken.sol:46" + }, + { + "contract": "StakedToken", + "label": "isBlacklisted", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts\\StakedToken.sol:48" + }, + { + "contract": "StakedToken", + "label": "downstreamCaller", + "type": "t_contract(DownstreamCaller)986", + "src": "contracts\\StakedToken.sol:54" + } + ], + "types": { + "t_address": { + "label": "address" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(DownstreamCaller)986": { + "label": "contract DownstreamCaller" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + } + }, + "admin": { + "address": "0x857876080CE877b2F1c5DC053Eca6047417bE2dA", + "txHash": "0xaed4f0f994d49b5c3e6e3f80d87ef996e3fcb392a667f92da1f70389428f445d" + } +} diff --git a/.openzeppelin/ropsten-stDASH-2.json b/.openzeppelin/ropsten-stDASH-2.json new file mode 100644 index 0000000..76f1672 --- /dev/null +++ b/.openzeppelin/ropsten-stDASH-2.json @@ -0,0 +1,178 @@ +{ + "manifestVersion": "3.1", + "impls": { + "d4a9d30d775b980cf02533b51f3707a6911151e43596bd8fb695f5ed4d0f58ab": { + "address": "0x566963346DD63cC5116597Ed0Ccf69C7B663eF42", + "txHash": "0xcbe9411bb44357229153fe1cf28b13814fcc15587ae4056bd192c9858d2c0be3", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "initialized", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:21" + }, + { + "contract": "Initializable", + "label": "initializing", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:26" + }, + { + "contract": "Initializable", + "label": "______gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:61" + }, + { + "contract": "ContextUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\GSN\\Context.sol:37" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:18" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:78" + }, + { + "contract": "PausableUpgradeSafe", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:26" + }, + { + "contract": "PausableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:84" + }, + { + "contract": "StakedToken", + "label": "supplyController", + "type": "t_address", + "src": "contracts\\StakedToken.sol:29" + }, + { + "contract": "StakedToken", + "label": "MAX_UINT256", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:31" + }, + { + "contract": "StakedToken", + "label": "_maxExpectedSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:34" + }, + { + "contract": "StakedToken", + "label": "_sharesPerToken", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:36" + }, + { + "contract": "StakedToken", + "label": "_totalSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:37" + }, + { + "contract": "StakedToken", + "label": "_totalShares", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:38" + }, + { + "contract": "StakedToken", + "label": "_shareBalances", + "type": "t_mapping(t_address,t_uint256)", + "src": "contracts\\StakedToken.sol:40" + }, + { + "contract": "StakedToken", + "label": "_allowedTokens", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts\\StakedToken.sol:42" + }, + { + "contract": "StakedToken", + "label": "_name", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:44" + }, + { + "contract": "StakedToken", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:45" + }, + { + "contract": "StakedToken", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts\\StakedToken.sol:46" + }, + { + "contract": "StakedToken", + "label": "isBlacklisted", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts\\StakedToken.sol:48" + }, + { + "contract": "StakedToken", + "label": "downstreamCaller", + "type": "t_contract(DownstreamCaller)986", + "src": "contracts\\StakedToken.sol:54" + } + ], + "types": { + "t_address": { + "label": "address" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(DownstreamCaller)986": { + "label": "contract DownstreamCaller" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + } + }, + "admin": { + "address": "0x56840929B67f78DE8a02b4D66CAcB49A8B983f88", + "txHash": "0x5368fedc674e8a9ccb33f6140ab4a25dc909e1ba78aa07dbaa685e333c433591" + } +} diff --git a/.openzeppelin/ropsten-stDIVI.json b/.openzeppelin/ropsten-stDIVI.json new file mode 100644 index 0000000..bd2e2ee --- /dev/null +++ b/.openzeppelin/ropsten-stDIVI.json @@ -0,0 +1,178 @@ +{ + "manifestVersion": "3.1", + "impls": { + "d4a9d30d775b980cf02533b51f3707a6911151e43596bd8fb695f5ed4d0f58ab": { + "address": "0x0A931Ecf12e95317635DF2dB96980f232BA59A47", + "txHash": "0x6da7b8583992a01858d9938dd8fc814fadefdbe470473f04081e8f34d9946727", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "initialized", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:21" + }, + { + "contract": "Initializable", + "label": "initializing", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:26" + }, + { + "contract": "Initializable", + "label": "______gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:61" + }, + { + "contract": "ContextUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\GSN\\Context.sol:37" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:18" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:78" + }, + { + "contract": "PausableUpgradeSafe", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:26" + }, + { + "contract": "PausableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:84" + }, + { + "contract": "StakedToken", + "label": "supplyController", + "type": "t_address", + "src": "contracts\\StakedToken.sol:29" + }, + { + "contract": "StakedToken", + "label": "MAX_UINT256", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:31" + }, + { + "contract": "StakedToken", + "label": "_maxExpectedSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:34" + }, + { + "contract": "StakedToken", + "label": "_sharesPerToken", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:36" + }, + { + "contract": "StakedToken", + "label": "_totalSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:37" + }, + { + "contract": "StakedToken", + "label": "_totalShares", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:38" + }, + { + "contract": "StakedToken", + "label": "_shareBalances", + "type": "t_mapping(t_address,t_uint256)", + "src": "contracts\\StakedToken.sol:40" + }, + { + "contract": "StakedToken", + "label": "_allowedTokens", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts\\StakedToken.sol:42" + }, + { + "contract": "StakedToken", + "label": "_name", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:44" + }, + { + "contract": "StakedToken", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:45" + }, + { + "contract": "StakedToken", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts\\StakedToken.sol:46" + }, + { + "contract": "StakedToken", + "label": "isBlacklisted", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts\\StakedToken.sol:48" + }, + { + "contract": "StakedToken", + "label": "downstreamCaller", + "type": "t_contract(DownstreamCaller)986", + "src": "contracts\\StakedToken.sol:54" + } + ], + "types": { + "t_address": { + "label": "address" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(DownstreamCaller)986": { + "label": "contract DownstreamCaller" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + } + }, + "admin": { + "address": "0xeaB2cE0Af7d0750bb050e2f12D3289FE4469A2FC", + "txHash": "0x5adeca2476f0094271e0d0002e1820002d15c7ca335b4298ef9c12c2392711ee" + } +} diff --git a/.openzeppelin/ropsten-stDOT.json b/.openzeppelin/ropsten-stDOT.json new file mode 100644 index 0000000..f53f959 --- /dev/null +++ b/.openzeppelin/ropsten-stDOT.json @@ -0,0 +1,178 @@ +{ + "manifestVersion": "3.1", + "impls": { + "d4a9d30d775b980cf02533b51f3707a6911151e43596bd8fb695f5ed4d0f58ab": { + "address": "0xC2F0462E4f01D2d88a40Ea3bC3b48E5228C42429", + "txHash": "0xbc242164d43e2c240f471c9f5b6d2244f26fe9bbc7d95e850b11becd62b688e3", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "initialized", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:21" + }, + { + "contract": "Initializable", + "label": "initializing", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:26" + }, + { + "contract": "Initializable", + "label": "______gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:61" + }, + { + "contract": "ContextUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\GSN\\Context.sol:37" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:18" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:78" + }, + { + "contract": "PausableUpgradeSafe", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:26" + }, + { + "contract": "PausableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:84" + }, + { + "contract": "StakedToken", + "label": "supplyController", + "type": "t_address", + "src": "contracts\\StakedToken.sol:29" + }, + { + "contract": "StakedToken", + "label": "MAX_UINT256", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:31" + }, + { + "contract": "StakedToken", + "label": "_maxExpectedSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:34" + }, + { + "contract": "StakedToken", + "label": "_sharesPerToken", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:36" + }, + { + "contract": "StakedToken", + "label": "_totalSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:37" + }, + { + "contract": "StakedToken", + "label": "_totalShares", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:38" + }, + { + "contract": "StakedToken", + "label": "_shareBalances", + "type": "t_mapping(t_address,t_uint256)", + "src": "contracts\\StakedToken.sol:40" + }, + { + "contract": "StakedToken", + "label": "_allowedTokens", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts\\StakedToken.sol:42" + }, + { + "contract": "StakedToken", + "label": "_name", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:44" + }, + { + "contract": "StakedToken", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:45" + }, + { + "contract": "StakedToken", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts\\StakedToken.sol:46" + }, + { + "contract": "StakedToken", + "label": "isBlacklisted", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts\\StakedToken.sol:48" + }, + { + "contract": "StakedToken", + "label": "downstreamCaller", + "type": "t_contract(DownstreamCaller)986", + "src": "contracts\\StakedToken.sol:54" + } + ], + "types": { + "t_address": { + "label": "address" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(DownstreamCaller)986": { + "label": "contract DownstreamCaller" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + } + }, + "admin": { + "address": "0x84e9Ed3962e582c1D7482439d01b929b556edE83", + "txHash": "0xa9b0bb18a247ba064c0796f1ca040a8b2107a9531125506a3d6ebf35c488b722" + } +} diff --git a/.openzeppelin/ropsten-stMATIC.json b/.openzeppelin/ropsten-stMATIC.json new file mode 100644 index 0000000..c8ca204 --- /dev/null +++ b/.openzeppelin/ropsten-stMATIC.json @@ -0,0 +1,178 @@ +{ + "manifestVersion": "3.1", + "impls": { + "d4a9d30d775b980cf02533b51f3707a6911151e43596bd8fb695f5ed4d0f58ab": { + "address": "0xEE9EfB2416070c37C4AF75df2eE43C15F3BfFBBa", + "txHash": "0x3c3bdba61ae47760dc9fa121d24f68fb8db8ff5cdb76bc4a2f691743150b39dd", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "initialized", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:21" + }, + { + "contract": "Initializable", + "label": "initializing", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:26" + }, + { + "contract": "Initializable", + "label": "______gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:61" + }, + { + "contract": "ContextUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\GSN\\Context.sol:37" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:18" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:78" + }, + { + "contract": "PausableUpgradeSafe", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:26" + }, + { + "contract": "PausableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:84" + }, + { + "contract": "StakedToken", + "label": "supplyController", + "type": "t_address", + "src": "contracts\\StakedToken.sol:29" + }, + { + "contract": "StakedToken", + "label": "MAX_UINT256", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:31" + }, + { + "contract": "StakedToken", + "label": "_maxExpectedSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:34" + }, + { + "contract": "StakedToken", + "label": "_sharesPerToken", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:36" + }, + { + "contract": "StakedToken", + "label": "_totalSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:37" + }, + { + "contract": "StakedToken", + "label": "_totalShares", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:38" + }, + { + "contract": "StakedToken", + "label": "_shareBalances", + "type": "t_mapping(t_address,t_uint256)", + "src": "contracts\\StakedToken.sol:40" + }, + { + "contract": "StakedToken", + "label": "_allowedTokens", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts\\StakedToken.sol:42" + }, + { + "contract": "StakedToken", + "label": "_name", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:44" + }, + { + "contract": "StakedToken", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:45" + }, + { + "contract": "StakedToken", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts\\StakedToken.sol:46" + }, + { + "contract": "StakedToken", + "label": "isBlacklisted", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts\\StakedToken.sol:48" + }, + { + "contract": "StakedToken", + "label": "downstreamCaller", + "type": "t_contract(DownstreamCaller)986", + "src": "contracts\\StakedToken.sol:54" + } + ], + "types": { + "t_address": { + "label": "address" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(DownstreamCaller)986": { + "label": "contract DownstreamCaller" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + } + }, + "admin": { + "address": "0x5A0c3ee8a5246708bBeDf6b6A6AA9F286Da0c1F7", + "txHash": "0x6a7e830e854213ec16e33b86d5f37a7feaa93e9bfa88119ac620baaf5e167944" + } +} diff --git a/.openzeppelin/ropsten-stXYM.json b/.openzeppelin/ropsten-stXYM.json new file mode 100644 index 0000000..21de3c0 --- /dev/null +++ b/.openzeppelin/ropsten-stXYM.json @@ -0,0 +1,178 @@ +{ + "manifestVersion": "3.1", + "impls": { + "d4a9d30d775b980cf02533b51f3707a6911151e43596bd8fb695f5ed4d0f58ab": { + "address": "0xaA572D140e7eE4B7637eA98a230976f793c33cCb", + "txHash": "0xab05eb8afc0e9eac5cbe70b03f2c2a98d040c01ce9ac17dc7e12be11e33fa7e0", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "initialized", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:21" + }, + { + "contract": "Initializable", + "label": "initializing", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:26" + }, + { + "contract": "Initializable", + "label": "______gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:61" + }, + { + "contract": "ContextUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\GSN\\Context.sol:37" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:18" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:78" + }, + { + "contract": "PausableUpgradeSafe", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:26" + }, + { + "contract": "PausableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:84" + }, + { + "contract": "StakedToken", + "label": "supplyController", + "type": "t_address", + "src": "contracts\\StakedToken.sol:29" + }, + { + "contract": "StakedToken", + "label": "MAX_UINT256", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:31" + }, + { + "contract": "StakedToken", + "label": "_maxExpectedSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:34" + }, + { + "contract": "StakedToken", + "label": "_sharesPerToken", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:36" + }, + { + "contract": "StakedToken", + "label": "_totalSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:37" + }, + { + "contract": "StakedToken", + "label": "_totalShares", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:38" + }, + { + "contract": "StakedToken", + "label": "_shareBalances", + "type": "t_mapping(t_address,t_uint256)", + "src": "contracts\\StakedToken.sol:40" + }, + { + "contract": "StakedToken", + "label": "_allowedTokens", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts\\StakedToken.sol:42" + }, + { + "contract": "StakedToken", + "label": "_name", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:44" + }, + { + "contract": "StakedToken", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:45" + }, + { + "contract": "StakedToken", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts\\StakedToken.sol:46" + }, + { + "contract": "StakedToken", + "label": "isBlacklisted", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts\\StakedToken.sol:48" + }, + { + "contract": "StakedToken", + "label": "downstreamCaller", + "type": "t_contract(DownstreamCaller)986", + "src": "contracts\\StakedToken.sol:54" + } + ], + "types": { + "t_address": { + "label": "address" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(DownstreamCaller)986": { + "label": "contract DownstreamCaller" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + } + }, + "admin": { + "address": "0xBc70eDB21381D020E13d5caeE7B172584F3218Ba", + "txHash": "0x8d323eb41c2561dc3202e77b167ed63fea879c6233f8f7941585413e77aa964d" + } +} diff --git a/.openzeppelin/ropsten-test.json b/.openzeppelin/ropsten-test.json new file mode 100644 index 0000000..d0740b4 --- /dev/null +++ b/.openzeppelin/ropsten-test.json @@ -0,0 +1,347 @@ +{ + "manifestVersion": "3.1", + "impls": { + "d4a9d30d775b980cf02533b51f3707a6911151e43596bd8fb695f5ed4d0f58ab": { + "address": "0xfa7B7542ccF084B30027940F67D5F9B31d607443", + "txHash": "0x1b044644d81f4dc6155afe9684f3414df6e453990395182e51f295e355f475fa", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "initialized", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:21" + }, + { + "contract": "Initializable", + "label": "initializing", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:26" + }, + { + "contract": "Initializable", + "label": "______gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:61" + }, + { + "contract": "ContextUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\GSN\\Context.sol:37" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:18" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:78" + }, + { + "contract": "PausableUpgradeSafe", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:26" + }, + { + "contract": "PausableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:84" + }, + { + "contract": "StakedToken", + "label": "supplyController", + "type": "t_address", + "src": "contracts\\StakedToken.sol:29" + }, + { + "contract": "StakedToken", + "label": "MAX_UINT256", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:31" + }, + { + "contract": "StakedToken", + "label": "_maxExpectedSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:34" + }, + { + "contract": "StakedToken", + "label": "_sharesPerToken", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:36" + }, + { + "contract": "StakedToken", + "label": "_totalSupply", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:37" + }, + { + "contract": "StakedToken", + "label": "_totalShares", + "type": "t_uint256", + "src": "contracts\\StakedToken.sol:38" + }, + { + "contract": "StakedToken", + "label": "_shareBalances", + "type": "t_mapping(t_address,t_uint256)", + "src": "contracts\\StakedToken.sol:40" + }, + { + "contract": "StakedToken", + "label": "_allowedTokens", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts\\StakedToken.sol:42" + }, + { + "contract": "StakedToken", + "label": "_name", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:44" + }, + { + "contract": "StakedToken", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts\\StakedToken.sol:45" + }, + { + "contract": "StakedToken", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts\\StakedToken.sol:46" + }, + { + "contract": "StakedToken", + "label": "isBlacklisted", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts\\StakedToken.sol:48" + }, + { + "contract": "StakedToken", + "label": "downstreamCaller", + "type": "t_contract(DownstreamCaller)986", + "src": "contracts\\StakedToken.sol:54" + } + ], + "types": { + "t_address": { + "label": "address" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(DownstreamCaller)986": { + "label": "contract DownstreamCaller" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + }, + "6f8a9dea41b7ad2679825b90488f9b7e473efa4d89ea3cda073c06f9db4f9d4c": { + "address": "0xA9B29c6FeBE4F76fb1055C5a60240D8dE32d2F10", + "txHash": "0x1301fbdc511607bdbd42edcbea8b7a4a3273bd03fbf3ba9f0a68ce6a08e4a9eb", + "layout": { + "storage": [ + { + "contract": "Initializable", + "label": "initialized", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:21" + }, + { + "contract": "Initializable", + "label": "initializing", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:26" + }, + { + "contract": "Initializable", + "label": "______gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\Initializable.sol:61" + }, + { + "contract": "ContextUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)50_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\GSN\\Context.sol:37" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "_owner", + "type": "t_address", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:18" + }, + { + "contract": "OwnableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\access\\Ownable.sol:78" + }, + { + "contract": "PausableUpgradeSafe", + "label": "_paused", + "type": "t_bool", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:26" + }, + { + "contract": "PausableUpgradeSafe", + "label": "__gap", + "type": "t_array(t_uint256)49_storage", + "src": "@openzeppelin\\contracts-ethereum-package\\contracts\\utils\\Pausable.sol:84" + }, + { + "contract": "StakedTokenV2", + "label": "supplyController", + "type": "t_address", + "src": "contracts\\StakedTokenV2.sol:29" + }, + { + "contract": "StakedTokenV2", + "label": "MAX_UINT256", + "type": "t_uint256", + "src": "contracts\\StakedTokenV2.sol:31" + }, + { + "contract": "StakedTokenV2", + "label": "_maxExpectedSupply", + "type": "t_uint256", + "src": "contracts\\StakedTokenV2.sol:34" + }, + { + "contract": "StakedTokenV2", + "label": "_sharesPerToken", + "type": "t_uint256", + "src": "contracts\\StakedTokenV2.sol:36" + }, + { + "contract": "StakedTokenV2", + "label": "_totalSupply", + "type": "t_uint256", + "src": "contracts\\StakedTokenV2.sol:37" + }, + { + "contract": "StakedTokenV2", + "label": "_totalShares", + "type": "t_uint256", + "src": "contracts\\StakedTokenV2.sol:38" + }, + { + "contract": "StakedTokenV2", + "label": "_shareBalances", + "type": "t_mapping(t_address,t_uint256)", + "src": "contracts\\StakedTokenV2.sol:40" + }, + { + "contract": "StakedTokenV2", + "label": "_allowedTokens", + "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", + "src": "contracts\\StakedTokenV2.sol:42" + }, + { + "contract": "StakedTokenV2", + "label": "_name", + "type": "t_string_storage", + "src": "contracts\\StakedTokenV2.sol:44" + }, + { + "contract": "StakedTokenV2", + "label": "_symbol", + "type": "t_string_storage", + "src": "contracts\\StakedTokenV2.sol:45" + }, + { + "contract": "StakedTokenV2", + "label": "_decimals", + "type": "t_uint8", + "src": "contracts\\StakedTokenV2.sol:46" + }, + { + "contract": "StakedTokenV2", + "label": "isBlacklisted", + "type": "t_mapping(t_address,t_bool)", + "src": "contracts\\StakedTokenV2.sol:48" + }, + { + "contract": "StakedTokenV2", + "label": "downstreamCaller", + "type": "t_contract(DownstreamCaller)986", + "src": "contracts\\StakedTokenV2.sol:54" + } + ], + "types": { + "t_address": { + "label": "address" + }, + "t_uint256": { + "label": "uint256" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)" + }, + "t_mapping(t_address,t_mapping(t_address,t_uint256))": { + "label": "mapping(address => mapping(address => uint256))" + }, + "t_string_storage": { + "label": "string" + }, + "t_uint8": { + "label": "uint8" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)" + }, + "t_bool": { + "label": "bool" + }, + "t_contract(DownstreamCaller)986": { + "label": "contract DownstreamCaller" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]" + } + } + } + } + }, + "admin": { + "address": "0x5f4AFb40fF9D02915bFfCf61BcA1c178F4D83ee1", + "txHash": "0x90495bde997413fc62781bc85ee1db400ec6672ee2574520826ee66a89dea724" + } +} diff --git a/airdop.csv b/airdop.csv new file mode 100644 index 0000000..598ed61 --- /dev/null +++ b/airdop.csv @@ -0,0 +1,78 @@ +0x3d31a92dc4416b24b5e2a96654a0cb519c92bcf5,10093742188068 +0x0349923ae2b35ff4f0099869aeea99d1f3fd12a9,23952868924 +0x7569ad1126245da5c086310fc347adb42d5b9a25,666626626594492 +0xb836e131b0936ef0037eacce91473e263ad022aa,14003036256512 +0x2ca7eae980b0d71c453bcd15a5aaccc9884465ea,15254425564383 +0xacf22f5efef78ab84c169269b7a2e2dcd1066aaa,100651922 +0xcada97a119619e0ae0f84b63805fa54077fd299f,1273235844 +0x07262bcc6a584ad9a84a966a3a14850c04f4d184,91395473 +0x99d7c16e1a1c1f1269bff7eca02da30808e1f66e,906671412292 +0x9e1b3ecb02ea30c634ca174a0e7f1ba4bd84c051,674766358 +0x540f88b327bc2e79a55611b53885519c1e031533,529193880974 +0x3f86a3993c330dae0193b6081d49b32fb21090b8,1406318564 +0xcb8cf4fd3b7ee32c348abe607e978a1fccc86f0f,34051250 +0x1b3006d57d5d9653a4ecaea6cfb0fd72a1537cc9,1 +0x71804a22d8734c9e22c4196574596942d63beede,52662742 +0x985e0edfa65a19b7ad2bac546903fff6cf22d223,21377816565 +0x79daf1f839f5fb74f4610298e76a97b577aa2a84,25984034 +0x3c6b3a1d05cc37b3540ed74eebac7f9b85d67a53,10066301703 +0xc56ca8d0351b606863d3c04f7e84170f09d6c980,10043 +0x11ededebf63bef0ea2d2d071bdf88f71543ec6fb,28463983862 +0x877315c3f4c54900fadf9229331f764f5975ccda,19522386934 +0xe14ce18903b0d3678a098f3bdeda0aac3790ac3b,36883444317228 +0xc64de5e0f97c21606e1f31426eb5c98ab729c08e,22375764465 +0xcd2f6558e35dd1aa29c7dbdcbb5c8cc59c2ab6e6,1189123498746 +0xe8a9e9c77da7dd1a06b7b373f4ca50cbb5850ebb,3168417841 +0x32dc24c8979a3d1cc0502f240603993934742963,10299024729347 +0x169068cc640d9a8c7c016112bc34c2d35dec41a1,131116306 +0xc2a452f5dfb0d6acfb36cf6b892c41407fe7c3a3,500000000000 +0xd3c18e5b44487b9a9ee16e613558ada56c0b465f,19343415325 +0x932183dec18c6fb3b7771f9280f363f2aa6477a6,263586017000 +0xfd85025ec7c9043b6afa27ae3dc806774fc5e650,635683925596 +0xe4e81a38ea6d480e4f21abdbe34df076621b9113,5022559607069 +0x6f62fa3964d392da56e1b3ca085eacf4a3c56410,11357668416 +0x0fd542324d5bfd990eaa27a4b41d2ed020bdf00c,17142667884 +0xbf50ee70e9e9e81d30306ce5abc22f720d01ebf3,2814913351 +0x9747d9a97619bee9f3ab529b303886e967cead6d,116417680560 +0xb3162d6e40b168b6bafc8b0d8b9326fac2b6f5b8,182981420033 +0xd9233c98d84e50f07b122ee0de0a6a50f49127e0,10035560606 +0xa8f0493f916508c7c3e24711262487a0452a1837,22059626300 +0x099de6a7d3bca32e47f956ac162711070dbbeb38,3255079940160 +0xafecaafb05e46a74f480885a14298f1ece3e20fa,23640330638 +0xe0356e5604e5262333ece1be4ac815125143e7f5,15041763375 +0x0918a8d885ca614ce73aff50d00af72893d51bc2,511133448721 +0x27672f9e8229c60da3cd131833123fd77233a2dc,149357547006 +0x6694be1f7d949f4634352791b03bfa2720ab04f5,30891421718 +0x3af503a5197e6ce5017e5dfa39d3e751293108de,557027599288 +0x95785ddb6b7c2069520a547bda324359600fee01,100030575857 +0x6d162347ec5a54d33d312f6f4e680889161d6084,133202334935 +0x9e46eb267d3de2e448aa4467443f5b1af2f0ab04,25058140709 +0x1cd679075fe1ff1d12a8c8f1c1ff055915635a2f,300674344665 +0x97f3e450796ed8f8d4634d85e3ee96f50c85673b,12928058455 +0x00fac16c3fbcc591f5a7e358054850ae5e6ea90f,47342677328 +0x5058bea1b2b6abf432907969ae20e5050dafd23a,4239059052 +0xf7bae44bf86a69a44606ad3002eb07ee75d32dcd,400741518540 +0xdebf3e3437b69d9f9724fa3236d6d260e20c78bb,3131219037931 +0x042329fb442b46e1a9c422c624fb0042daad4126,3903331011391 +0xc40037dbe19d0e208904a5cfbd8edaa34a87958a,1 +0x00000000e8b06d9bf77ba40fc89e4eaa4f225e5c,1 +0xb7562b31fd7fc97999fddf11f25c9a4067950f04,38598584 +0xc09d5eb677746337fddd94490bd2b0fb2ea4c650,1096471441687 +0x16e86d612b39686bbf0a854e17b86829628d846f,5004722415 +0x000000000000084e91743124a982076c59f10084,1 +0xece8e0bb8cd0820d190d32625e8e8cef263976ca,300258170829 +0x72d7b582972f443636c896e9f55accee11d939b1,22581810118 +0xd73a8f7fe539d7ccdab8d3f5e39844017a5ca9bb,9871655665 +0x741720080a5875efa8299d57996e91b93b38e2f5,2845932652 +0x7cc4effaa17a4d1f7f32c8e54685c6158e2eb5c6,29413133847 +0xcf24dc3c558815a1dd9dcac79bd646d49035f8a7,163111171373 +0xd1a56c07e3717e7bb83e35f2c72a67f24313ac0d,73373727028 +0x2b79a409190dc42da19d728a9a6a22287bba917d,25119941157 +0xe35098b3d166946b0309fd0377f3ce0eef036643,17730531614 +0x720a9125672647ab487e614fe3594449c5dae80f,65032393423 +0xf73f3c6ec4c9d26e2122eb6095a057d15ed1a8b1,1531022301 +0x5a6f4b385e8e6620ca2aaa722bab4a907914a80a,178552636686 +0xb65b4bcd5e6ac97de1944212736a32c9ad1cf607,30593231741 +0x7f1f50a32fa7208ffd5c6cda9d062ced2a7d5d33,25738036368 +0xb18b7795d46f9d55a4f0e47c560aa38bb5e8e340,259253476280 +0x85d548fe2d95bc0bb83f311744d67e6a4c9893e2,355124022680 diff --git a/contracts/StakedTokenV2.sol b/contracts/StakedTokenV2.sol new file mode 100644 index 0000000..da1049f --- /dev/null +++ b/contracts/StakedTokenV2.sol @@ -0,0 +1,465 @@ +// contracts/StakedToken.sol +// SPDX-License-Identifier: MIT +pragma solidity 0.6.10; + +import "@openzeppelin/contracts-ethereum-package/contracts/Initializable.sol"; +import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts-ethereum-package/contracts/utils/Pausable.sol"; +import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; +import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; +import "./DownstreamCaller.sol"; + +contract StakedTokenV2 is IERC20, Initializable, OwnableUpgradeSafe, PausableUpgradeSafe { + using SafeMath for uint256; + + /** + * @dev Emitted when supply controller is changed + */ + event LogSupplyControllerUpdated(address supplyController); + /** + * @dev Emitted when token distribution happens + */ + event LogTokenDistribution(uint256 oldTotalSupply, uint256 supplyChange, bool positive, uint256 newTotalSupply); + /** + * @dev Emitted if total supply exceeds maximum expected supply + */ + event WarningMaxExpectedSupplyExceeded(uint256 totalSupply, uint256 totalShares); + + + address public supplyController; + + uint256 private MAX_UINT256; + + // Defines the multiplier applied to shares to arrive at the underlying balance + uint256 private _maxExpectedSupply; + + uint256 private _sharesPerToken; + uint256 private _totalSupply; + uint256 private _totalShares; + + mapping(address => uint256) private _shareBalances; + //Denominated in tokens not shares, to align with user expectations + mapping(address => mapping(address => uint256)) private _allowedTokens; + + string private _name; + string private _symbol; + uint8 private _decimals; + + mapping(address => bool) public isBlacklisted; + /** + * @dev Emitted when account blacklist status changes + */ + event Blacklisted(address indexed account, bool isBlacklisted); + + DownstreamCaller public downstreamCaller; + + modifier onlySupplyController() { + require(msg.sender == supplyController); + _; + } + + modifier validRecipient(address to) { + require(to != address(0x0)); + require(to != address(this)); + _; + } + + /** + * Set the address that can mint, burn and rebase + * + * @param name_ Name of the token + * @param symbol_ Symbol of the token + * @param decimals_ Decimal places of the token - purely for display purposes + * @param maxExpectedSupply_ Maximum possilbe supply of the token. + Value should be chosen such that it could never be realistically exceeded based on the underlying token. + Not binding, can be exceeded in reality, with the risk of losing precision in a reward distribution event + * @param initialSupply_ Inital supply of the token, sent to the creator of the token + */ + function initialize( + string memory name_, + string memory symbol_, + uint8 decimals_, + uint256 maxExpectedSupply_, + uint256 initialSupply_ + ) public initializer { + __Ownable_init(); + __Pausable_init(); + supplyController = msg.sender; + + _name = name_; + _symbol = symbol_; + _decimals = decimals_; + + MAX_UINT256 = ~uint256(0); + + // Maximise precision by picking the largest possible sharesPerToken value + // It is crucial to pick a maxSupply value that will never be exceeded + _sharesPerToken = MAX_UINT256.div(maxExpectedSupply_); + + _maxExpectedSupply = maxExpectedSupply_; + _totalSupply = initialSupply_; + _totalShares = initialSupply_.mul(_sharesPerToken); + _shareBalances[msg.sender] = _totalShares; + + downstreamCaller = new DownstreamCaller(); + + emit Transfer(address(0x0), msg.sender, _totalSupply); + } + + /** + * Set the address that can mint, burn and rebase + * + * @param supplyController_ Address of the new supply controller + */ + function setSupplyController(address supplyController_) external onlyOwner { + require(supplyController_ != address(0x0), "invalid address"); + supplyController = supplyController_; + emit LogSupplyControllerUpdated(supplyController); + } + + /** + * Distribute a supply increase or decrease to all token holders proportionally + * + * @param supplyChange_ Increase of supply in token units + * @return The updated total supply + */ + function distributeTokens(uint256 supplyChange_, bool positive) external onlySupplyController returns (uint256) { + uint256 newTotalSupply; + if (positive) { + newTotalSupply = _totalSupply.add(supplyChange_); + } else { + newTotalSupply = _totalSupply.sub(supplyChange_); + } + + require(newTotalSupply > 0, "rebase cannot make supply 0"); + + _sharesPerToken = _totalShares.div(newTotalSupply); + + // Set correct total supply in case of mismatch caused by integer division + newTotalSupply = _totalShares.div(_sharesPerToken); + + emit LogTokenDistribution(_totalSupply, supplyChange_, positive, newTotalSupply); + + _totalSupply = newTotalSupply; + + if (_totalSupply > _maxExpectedSupply) { + emit WarningMaxExpectedSupplyExceeded(_totalSupply, _totalShares); + } + + // Call downstream transactions + downstreamCaller.executeTransactions(); + + return _totalSupply; + } + + /** + * @dev Returns the name of the token. + */ + function name() external view returns (string memory) { + return _name; + } + + /** + * Set the name of the token + * @param name_ the new name of the token. + */ + function setName(string calldata name_) external onlyOwner { + _name = name_; + } + + /** + * @dev Returns the symbol of the token, usually a shorter version of the + * name. + */ + function symbol() external view returns (string memory) { + return _symbol; + } + + /** + * Set the symbol of the token + * @param symbol_ the new symbol of the token. + */ + function setSymbol(string calldata symbol_) external onlyOwner { + _symbol = symbol_; + } + + /** + * @dev Returns the number of decimals used to get its user representation. + * For example, if `decimals` equals `2`, a balance of `505` tokens should + * be displayed to a user as `5,05` (`505 / 10 ** 2`). + * + * Tokens usually opt for a value of 18, imitating the relationship between + * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is + * called. + * + * NOTE: This information is only used for _display_ purposes: it in + * no way affects any of the arithmetic of the contract, including + * {IERC20-balanceOf} and {IERC20-transfer}. + */ + function decimals() external view returns (uint8) { + return _decimals; + } + + /** + * @return The total supply of the underlying token + */ + function totalSupply() external override view returns (uint256) { + return _totalSupply; + } + + /** + * @return The total supply in shares + */ + function totalShares() external view returns (uint256) { + return _totalShares; + } + + /** + * @param who The address to query. + * @return The balance of the specified address. + */ + function balanceOf(address who) external override view returns (uint256) { + return _shareBalances[who].div(_sharesPerToken); + } + + /** + * @param who The address to query. + * @return The balance of the specified address in shares. + */ + function sharesOf(address who) external view returns (uint256) { + return _shareBalances[who]; + } + + /** + * @dev Transfer tokens to a specified address. + * @param to The address to transfer to. + * @param value The amount to be transferred. + * @return True on success, false otherwise. + */ + function transfer(address to, uint256 value) external override validRecipient(to) whenNotPaused returns (bool) { + // require(!isBlacklisted[msg.sender], "from blacklisted"); + require(!isBlacklisted[to], "to blacklisted"); + + uint256 shareValue = value.mul(_sharesPerToken); + _shareBalances[msg.sender] = _shareBalances[msg.sender].sub( + shareValue, + "transfer amount exceed account balance" + ); + _shareBalances[to] = _shareBalances[to].add(shareValue); + emit Transfer(msg.sender, to, value); + return true; + } + + /** + * @dev Function to check the amount of tokens that an owner has allowed to a spender. + * @param owner_ The address which owns the funds. + * @param spender The address which will spend the funds. + * @return The number of tokens still available for the spender. + */ + function allowance(address owner_, address spender) external override view returns (uint256) { + return _allowedTokens[owner_][spender]; + } + + /** + * @dev Transfer tokens from one address to another. + * @param from The address you want to send tokens from. + * @param to The address you want to transfer to. + * @param value The amount of tokens to be transferred. + */ + function transferFrom( + address from, + address to, + uint256 value + ) external override validRecipient(to) whenNotPaused returns (bool) { + require(!isBlacklisted[from], "from blacklisted"); + require(!isBlacklisted[to], "to blacklisted"); + + _allowedTokens[from][msg.sender] = _allowedTokens[from][msg.sender].sub( + value, + "transfer amount exceeds allowance" + ); + + uint256 shareValue = value.mul(_sharesPerToken); + _shareBalances[from] = _shareBalances[from].sub(shareValue, "transfer amount exceeds account balance"); + _shareBalances[to] = _shareBalances[to].add(shareValue); + emit Transfer(from, to, value); + + return true; + } + + /** + * @dev Approve the passed address to spend the specified amount of tokens on behalf of + * msg.sender. This method is included for ERC20 compatibility. + * increaseAllowance and decreaseAllowance should be used instead. + * Changing an allowance with this method brings the risk that someone may transfer both + * the old and the new allowance - if they are both greater than zero - if a transfer + * transaction is mined before the later approve() call is mined. + * + * @param spender The address which will spend the funds. + * @param value The amount of tokens to be spent. + */ + function approve(address spender, uint256 value) external override returns (bool) { + require(!isBlacklisted[msg.sender], "owner blacklisted"); + require(!isBlacklisted[spender], "spender blacklisted"); + require(spender != address(0x0), "invalid address"); + + _allowedTokens[msg.sender][spender] = value; + emit Approval(msg.sender, spender, value); + return true; + } + + /** + * @dev Increase the amount of tokens that an owner has allowed to a spender. + * This method should be used instead of approve() to avoid the double approval vulnerability + * described above. + * @param spender The address which will spend the funds. + * @param addedValue The amount of tokens to increase the allowance by. + */ + function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { + require(!isBlacklisted[msg.sender], "owner blacklisted"); + require(!isBlacklisted[spender], "spender blacklisted"); + require(spender != address(0x0), "invalid address"); + + _allowedTokens[msg.sender][spender] = _allowedTokens[msg.sender][spender].add(addedValue); + emit Approval(msg.sender, spender, _allowedTokens[msg.sender][spender]); + return true; + } + + /** + * @dev Decrease the amount of tokens that an owner has allowed to a spender. + * + * @param spender The address which will spend the funds. + * @param subtractedValue The amount of tokens to decrease the allowance by. + */ + function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { + require(!isBlacklisted[msg.sender], "owner blacklisted"); + require(!isBlacklisted[spender], "spender blacklisted"); + require(spender != address(0x0), "invalid address"); + + uint256 oldValue = _allowedTokens[msg.sender][spender]; + if (subtractedValue >= oldValue) { + _allowedTokens[msg.sender][spender] = 0; + } else { + _allowedTokens[msg.sender][spender] = oldValue.sub(subtractedValue); + } + emit Approval(msg.sender, spender, _allowedTokens[msg.sender][spender]); + return true; + } + + /** Creates `amount` tokens and assigns them to `account`, increasing + * the total supply, keeping the tokens per shares constant + * + * Emits a {Transfer} event with `from` set to the zero address. + * + * Requirements + * + * - `account` cannot be the zero address. + */ + function mint(address account, uint256 amount) external onlySupplyController validRecipient(account) { + require(!isBlacklisted[account], "account blacklisted"); + require(account != address(0x0), "invalid address"); + + _totalSupply = _totalSupply.add(amount); + uint256 shareAmount = amount.mul(_sharesPerToken); + _totalShares = _totalShares.add(shareAmount); + _shareBalances[account] = _shareBalances[account].add(shareAmount); + emit Transfer(address(0), account, amount); + + if (_totalSupply > _maxExpectedSupply) { + emit WarningMaxExpectedSupplyExceeded(_totalSupply, _totalShares); + } + } + + /** + * Destroys `amount` tokens from `supplyController` account, reducing the + * total supply while keeping the tokens per shares ratio constant + * + * Emits a {Transfer} event with `to` set to the zero address. + */ + function burn(uint256 amount) external onlySupplyController { + uint256 shareAmount = amount.mul(_sharesPerToken); + _shareBalances[supplyController] = _shareBalances[supplyController].sub(shareAmount, "burn amount exceeds balance"); + _totalShares = _totalShares.sub(shareAmount); + _totalSupply = _totalSupply.sub(amount); + emit Transfer(supplyController, address(0), amount); + } + + + // Downstream transactions + + /** + * @return Address of the downstream caller contract + */ + function downstreamCallerAddress() external view returns (address) { + return address(downstreamCaller); + } + + /** + * @param _downstreamCaller Address of the new downstream caller contract + */ + function setDownstreamCaller(DownstreamCaller _downstreamCaller) external onlyOwner { + downstreamCaller = _downstreamCaller; + } + + /** + * @notice Adds a transaction that gets called for a downstream receiver of token distributions + * @param destination Address of contract destination + * @param data Transaction data payload + * @return index of the newly added transaction + */ + function addTransaction(address destination, bytes memory data) external onlySupplyController returns(uint256) { + return downstreamCaller.addTransaction(destination, data); + } + + /** + * @param index Index of transaction to remove. + * Transaction ordering may have changed since adding. + */ + function removeTransaction(uint256 index) external onlySupplyController { + downstreamCaller.removeTransaction(index); + } + + /** + * @param index Index of transaction. Transaction ordering may have changed since adding. + * @param enabled True for enabled, false for disabled. + */ + function setTransactionEnabled(uint256 index, bool enabled) external onlySupplyController { + downstreamCaller.setTransactionEnabled(index, enabled); + } + + /** + * @return Number of transactions, both enabled and disabled, in transactions list. + */ + function transactionsSize() external view returns (uint256) { + return downstreamCaller.transactionsSize(); + } + + + /** + * @dev Triggers stopped state. + */ + function pause() external onlySupplyController { + _pause(); + } + + /** + * @dev Returns to normal state. + */ + function unpause() external onlySupplyController { + _unpause(); + } + + /** + * @dev Set blacklisted status for the account. + * @param account address to set blacklist flag for + * @param _isBlacklisted blacklist flag value + * + * Requirements: + * + * - `msg.sender` should be owner. + */ + function setBlacklisted(address account, bool _isBlacklisted) external onlySupplyController { + isBlacklisted[account] = _isBlacklisted; + emit Blacklisted(account, _isBlacklisted); + } +} diff --git a/contracts/Wrapper.sol b/contracts/Wrapper.sol new file mode 100644 index 0000000..6417fb3 --- /dev/null +++ b/contracts/Wrapper.sol @@ -0,0 +1,50 @@ + +// // contracts/Wrapper.sol +// // SPDX-License-Identifier: MIT +// pragma solidity >=0.6.0 <0.8.0; + +// import "@openzeppelin/contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +// import "./StakedToken.sol"; + +// contract Wrapper is ERC20Upgradeable { +// using SafeMathUpgradeable for uint256; + +// StakedToken token; + +// function initialize(address _token, string name, string symbol) public initializer { +// __ERC20_init(name, symbol); + +// token = StakedToken(token); +// _setupDecimals(token.decimals()); +// } + +// function balance() public view returns (uint256) { +// return token.balanceOf(address(this)); +// } + +// function deposit(uint256 _amount) public { +// unit256 _before = balance(); + +// require(token.transferFrom(msg.sender, address(this), _amount)); + +// unit256 _after = balance(); +// // Recompute amount in case of deflationary token +// _amount = _after.sub(_before); + +// unit256 shares = 0; +// if ( totalSupply() == 0) { +// shares = _amount; +// } else { +// shares = _amount.mul(totalSupply()).div(_before); +// } + +// _mint(msg.sender, shares); +// } + +// function withdraw(unit256 _shares) public { +// uint256 _amountToRedeem = _shares.mul(balance()).div(totalSupply()); +// _burn(msg.sender, _shares); + +// token.transfer(msg.sender, _amountToRedeem); +// } +// } diff --git a/hardhat.config.ts b/hardhat.config.ts index 591b553..67f212a 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -76,6 +76,7 @@ const config: HardhatUserConfig = { mainnet: { ...createHDAccountConfig("mainnet"), chainId: 1, + gasMultiplier: 1.2, }, }, paths: { diff --git a/package.json b/package.json index 1678f4d..5c1320c 100644 --- a/package.json +++ b/package.json @@ -90,6 +90,7 @@ }, "dependencies": { "@gnosis.pm/safe-contracts": "^1.2.0", + "@openzeppelin/contracts-upgradeable": "^4.1.0", "abi-decoder": "^2.4.0", "axios": "^0.21.1", "browser-env": "^3.3.0", diff --git a/scripts/add-downstream.ts b/scripts/add-downstream.ts index 5d5647c..832b2e8 100644 --- a/scripts/add-downstream.ts +++ b/scripts/add-downstream.ts @@ -14,7 +14,7 @@ async function main(): Promise { const StakedToken: ContractFactory = await ethers.getContractFactory("StakedToken"); const stakedToken = StakedToken.attach(stakedTokenAddress) as StakedToken; - const downstreamAddress = "0xfa2cbc26eea699d91b8c479e82c5cd3b93b065d9"; + const downstreamAddress = "0x70974f06338974d691fa38327ef25d1cf3e87ce6"; let ABI = ["function sync()"]; let iface = new ethers.utils.Interface(ABI); diff --git a/scripts/change-supply-controller.ts b/scripts/change-supply-controller.ts index cad4b66..d76c3e9 100644 --- a/scripts/change-supply-controller.ts +++ b/scripts/change-supply-controller.ts @@ -13,6 +13,8 @@ async function main(): Promise { // Ropsten - fireblocks // const newSupplyController = '0x1beC1E14b766CD13e0a151653C8f7dA3DA3630af'; + // ropsten - deployer + // const newSupplyController = '0x0b0B977facc378365E9AEdbe0bc28EE6Cd7f09Ed'; // Mainnet - fireblocks const newSupplyController = '0xE14ce18903B0d3678a098F3BdEDA0AAC3790Ac3B'; diff --git a/scripts/deploy-upgrade.ts b/scripts/deploy-upgrade.ts new file mode 100644 index 0000000..acf2b66 --- /dev/null +++ b/scripts/deploy-upgrade.ts @@ -0,0 +1,35 @@ + +import { ethers, upgrades } from "hardhat"; +import { Contract, ContractFactory } from "ethers"; + +async function main(): Promise { + // Hardhat always runs the compile task when running scripts through it. + // If this runs in a standalone fashion you may want to call compile manually + // to make sure everything is compiled + // await run("compile"); + + const [deployer] = await ethers.getSigners(); + + console.log( + "Deploying contracts with the account:", + await deployer.getAddress() + ); + console.log("Account balance:", (await deployer.getBalance()).toString()); + + + // We get the contract to deploy + const StakedToken: ContractFactory = await ethers.getContractFactory("StakedTokenV2"); + const upgrade: Contract = await upgrades.upgradeProxy('0x5f389b55A999043b1CE0acaa8e66E62cb4c40eE1', StakedToken); + await upgrade.deployed(); + + console.log(`Upgrade deployed to: `, upgrade.address); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch((error: Error) => { + console.error(error); + process.exit(1); + }); diff --git a/scripts/deploy.ts b/scripts/deploy.ts index 4783890..8b1edb7 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -16,10 +16,10 @@ async function main(): Promise { ); console.log("Account balance:", (await deployer.getBalance()).toString()); - const tokenName = "stakedXEM"; - const tokenSymbol = "stXEM"; - const tokenDecimals = 8; - const tokenMaxSupply = ethers.BigNumber.from(10).pow(10 + tokenDecimals + 8); + const tokenName = "test"; + const tokenSymbol = "test"; + const tokenDecimals = 18; + const tokenMaxSupply = ethers.BigNumber.from(10).pow(15 + tokenDecimals + 8); const tokenInitialSupply = ethers.BigNumber.from("0"); // We get the contract to deploy diff --git a/scripts/downstream-transactions.ts b/scripts/downstream-transactions.ts index f46b626..8d7af0f 100644 --- a/scripts/downstream-transactions.ts +++ b/scripts/downstream-transactions.ts @@ -2,6 +2,7 @@ import { ethers } from "hardhat"; import { Contract, ContractFactory } from "ethers"; import { StakedToken } from "../typechain/StakedToken"; +import { DownstreamCaller } from "../typechain/DownstreamCaller"; async function main(): Promise { // Hardhat always runs the compile task when running scripts through it. @@ -13,7 +14,16 @@ async function main(): Promise { const StakedToken: ContractFactory = await ethers.getContractFactory("StakedToken"); const stakedToken = StakedToken.attach(stakedTokenAddress) as StakedToken; - console.log(`Total downstream transactions: ${await stakedToken.transactionsSize()}`); + const txs = await stakedToken.transactionsSize(); + console.log(`Total downstream transactions: ${txs}`); + + const downstreamCallerAddress = await stakedToken.downstreamCallerAddress(); + const DownstreamCaller: ContractFactory = await ethers.getContractFactory("DownstreamCaller"); + const downstreamCaller = DownstreamCaller.attach(downstreamCallerAddress) as DownstreamCaller; + + for (let i=0; i { if (!availableAddresses[address] && !poolAddresses.includes(address)) { const calldata = contractInterface.encodeFunctionData('balanceOf', [address]); const balance = await getTokenBalance(calldata, tokenAddress, blockNumber); + if(address === '0xE14ce18903B0d3678a098F3BdEDA0AAC3790Ac3B'.toLowerCase()) { + console.log('yo', ethers.BigNumber.from(balance).toString()); + } availableAddresses[address] = ethers.BigNumber.from(balance); totalSupplyWithoutPools = totalSupplyWithoutPools.add(balance); } diff --git a/scripts/gnosis/change-supply-controller.ts b/scripts/gnosis/pause.ts similarity index 65% rename from scripts/gnosis/change-supply-controller.ts rename to scripts/gnosis/pause.ts index 7479da2..1999fbf 100644 --- a/scripts/gnosis/change-supply-controller.ts +++ b/scripts/gnosis/pause.ts @@ -10,16 +10,8 @@ async function main(): Promise { const stakedTokenAddress = process.env.STAKED_TOKEN_ADDRESS || ''; - // Ropsten - fireblocks - const newSupplyController = '0x1beC1E14b766CD13e0a151653C8f7dA3DA3630af'; - - // Mainnet - // const newSupplyController = '0x314f8e805B347af013CD952e0929CB573abbf4d1'; - // FireBlocks - // const newSupplyController = '0xE14ce18903B0d3678a098F3BdEDA0AAC3790Ac3B'; - const StakedToken: ContractFactory = await ethers.getContractFactory("StakedToken"); - const callData = StakedToken.interface.encodeFunctionData('setSupplyController', [newSupplyController]); + const callData = StakedToken.interface.encodeFunctionData('pause'); console.log("Call data", callData); } diff --git a/scripts/gnosis/prepare-upgrade.ts b/scripts/gnosis/prepare-upgrade.ts new file mode 100644 index 0000000..e601e99 --- /dev/null +++ b/scripts/gnosis/prepare-upgrade.ts @@ -0,0 +1,37 @@ + +import { ethers, upgrades } from "hardhat"; +import { Contract, ContractFactory } from "ethers"; + +async function main(): Promise { + // Hardhat always runs the compile task when running scripts through it. + // If this runs in a standalone fashion you may want to call compile manually + // to make sure everything is compiled + // await run("compile"); + + const stakedTokenAddress = process.env.STAKED_TOKEN_ADDRESS || ''; + + const proxyAdminAddress = ''; + const proxyAddress = stakedTokenAddress; + + const StakedToken: ContractFactory = await ethers.getContractFactory("StakedTokenV2"); + const newImplementationAddress = await upgrades.prepareUpgrade(proxyAddress, StakedToken); + + // Prepare gnosis call data + const proxyAdminABI = [ + "function upgrade(address proxy, address implementation)", + ]; + + const proxyAdmin = new ethers.Contract(proxyAdminAddress, proxyAdminABI); + const callData = proxyAdmin.interface.encodeFunctionData('upgrade', [proxyAddress, newImplementationAddress]); + + console.log("Call data for Gnosis", callData); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch((error: Error) => { + console.error(error); + process.exit(1); + }); diff --git a/scripts/mint.ts b/scripts/mint.ts index 3dee23f..b99939a 100644 --- a/scripts/mint.ts +++ b/scripts/mint.ts @@ -19,7 +19,7 @@ async function main(): Promise { // stakedDASH // const amount = ethers.BigNumber.from(10000000000); // stakedETH - const amount = ethers.BigNumber.from('100000000000000000000000'); + const amount = ethers.BigNumber.from('1000000000000000000000000'); // Rinkeby @@ -30,7 +30,7 @@ async function main(): Promise { // stakedXZC // const amount = ethers.BigNumber.from(100000000); - const recipient = '0x880772af311d7F3Bb2cf10A789Fa1264815f14e8'; + const recipient = '0xFE3FEec104E6B5c3dE77693652Bfc32AD7b5A76f'; const StakedToken: ContractFactory = await ethers.getContractFactory("StakedToken"); const stakedToken = StakedToken.attach(stakedTokenAddress) as StakedToken; diff --git a/scripts/rebase.ts b/scripts/rebase.ts index 01a04a7..775a376 100644 --- a/scripts/rebase.ts +++ b/scripts/rebase.ts @@ -9,8 +9,12 @@ async function main(): Promise { // to make sure everything is compiled // await run("compile"); + // Divi daily yield 0.001 + const stakedTokenAddress = process.env.STAKED_TOKEN_ADDRESS || ''; - const amount = ethers.BigNumber.from('10000000000000000000000'); + // const amount = ethers.BigNumber.from('1331000000000000000000'); + const amount = ethers.BigNumber.from('1112131286484589526014'); // ETH + // const amount = ethers.BigNumber.from('330000000000000000000'); // DIVI const positive = true; const StakedToken: ContractFactory = await ethers.getContractFactory("StakedToken"); diff --git a/scripts/set-blacklisted.ts b/scripts/set-blacklisted.ts new file mode 100644 index 0000000..d650771 --- /dev/null +++ b/scripts/set-blacklisted.ts @@ -0,0 +1,32 @@ + +import { ethers } from "hardhat"; +import { Contract, ContractFactory } from "ethers"; +import { StakedToken } from "../typechain/StakedToken"; + +async function main(): Promise { + // Hardhat always runs the compile task when running scripts through it. + // If this runs in a standalone fashion you may want to call compile manually + // to make sure everything is compiled + // await run("compile"); + + const stakedTokenAddress = process.env.STAKED_TOKEN_ADDRESS || ''; + // const address = '0x0bc8c42f8b1a40a1cc1dfd04d9e4148e342d5e51'; // ETH + const address = '0xbed67ad3ac03f82ebd467b52babeb94c3d239f07'; // stETH + const blacklisted = true; + + const StakedToken: ContractFactory = await ethers.getContractFactory("StakedToken"); + const stakedToken = StakedToken.attach(stakedTokenAddress) as StakedToken; + + + await stakedToken.setBlacklisted(address, blacklisted); + console.log(`Blacklisted ${address}: ${blacklisted}`); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch((error: Error) => { + console.error(error); + process.exit(1); + }); diff --git a/scripts/sign-message.ts b/scripts/sign-message.ts index bc01769..d38487d 100644 --- a/scripts/sign-message.ts +++ b/scripts/sign-message.ts @@ -8,7 +8,7 @@ async function main(): Promise { // If this runs in a standalone fashion you may want to call compile manually // to make sure everything is compiled // await run("compile"); - const message = "[Etherscan.io 26/01/2021 12:56:50] I, hereby verify that I am the owner/creator of the address [0x0C63cAE5fcC2Ca3dDE60a35e50362220651eBEc8]"; + const message = "[Etherscan.io 27/04/2021 15:58:37] I, hereby verify that I am the owner/creator of the address [0xd79311eb6c74c408e678b8364b69b4744a5778f4]"; const signer = (await ethers.getSigners())[0]; console.log((await signer.signMessage(message))); diff --git a/scripts/supply-controller.ts b/scripts/supply-controller.ts new file mode 100644 index 0000000..1d81464 --- /dev/null +++ b/scripts/supply-controller.ts @@ -0,0 +1,27 @@ + +import { ethers } from "hardhat"; +import { Contract, ContractFactory } from "ethers"; +import { StakedToken } from "../typechain/StakedToken"; + +async function main(): Promise { + // Hardhat always runs the compile task when running scripts through it. + // If this runs in a standalone fashion you may want to call compile manually + // to make sure everything is compiled + // await run("compile"); + + const stakedTokenAddress = process.env.STAKED_TOKEN_ADDRESS || ''; + + const StakedToken: ContractFactory = await ethers.getContractFactory("StakedToken"); + const stakedToken = StakedToken.attach(stakedTokenAddress) as StakedToken; + + console.log("Supply controller: ", await stakedToken.supplyController()); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch((error: Error) => { + console.error(error); + process.exit(1); + }); diff --git a/test/Wrapper.behavior.ts b/test/Wrapper.behavior.ts new file mode 100644 index 0000000..1e98b9f --- /dev/null +++ b/test/Wrapper.behavior.ts @@ -0,0 +1,80 @@ +import { Signer } from "@ethersproject/abstract-signer"; +import { expect } from "chai"; +import { ethers, upgrades } from "hardhat"; +import { StakedToken } from "../typechain/StakedToken"; +import { BigNumberish, BigNumber } from "ethers"; +import { MockDownstream } from "../typechain/MockDownstream"; +import { DownstreamCaller } from "../typechain/DownstreamCaller"; +import DownstreamCallerArtifact from "../artifacts/contracts/DownstreamCaller.sol/DownstreamCaller.json"; +import { deployContract } from "ethereum-waffle"; + +export function shouldBehaveLikeWrapper(_signers: Signer[], decimalsMultiplier: BigNumberish): void { + function toTokenAmount(amount: BigNumberish): BigNumber { + return ethers.BigNumber.from(amount).mul(decimalsMultiplier); + } + + describe("Initialization", async function () { + it("should be set up properly", async function () { + const stakedToken: StakedToken = this.stakedToken; + const owner = await _signers[0].getAddress(); + + expect(await stakedToken.name()).to.equal(this.name); + expect(await stakedToken.symbol()).to.equal(this.symbol); + expect(await stakedToken.decimals()).to.equal(this.decimals); + expect(await stakedToken.totalSupply()).to.equal(this.initialSupply); + expect(await stakedToken.balanceOf(owner)).to.equal(this.initialSupply); + expect(await stakedToken.owner()).to.equal(owner); + expect(await stakedToken.supplyController()).to.equal(owner); + }); + + it("should reject ETH transfers", async function () { + await expect(_signers[1].sendTransaction({ to: this.stakedToken.address, value: 1 })).to.be.reverted; + }); + }); + + + describe("Upgrades", async function () { + it("should be upgradeable", async function () { + const StakedToken = await ethers.getContractFactory("StakedToken"); + const StakedTokenV2 = await ethers.getContractFactory("StakedTokenMockV2"); + const mockDownstream: MockDownstream = this.mockDownstream; + + const instance = await upgrades.deployProxy(StakedToken, [this.name, this.symbol, this.decimals, this.maxSupply, this.initialSupply]); + + //Check balance is preserved + const recipient = await _signers[1].getAddress(); + const transferAmount = toTokenAmount(10); + await instance.transfer(recipient, transferAmount); + + // Check downstream caller still works after upgrade + let ABI = ["function updateOneArg(uint256 u)"]; + let iface = new ethers.utils.Interface(ABI); + const data = iface.encodeFunctionData("updateOneArg", [12345]); + await instance.addTransaction(mockDownstream.address, data); + + // Do the upgrade + const upgraded = await upgrades.upgradeProxy(instance.address, StakedTokenV2); + + // Check values + const name = await upgraded.name(); + expect(name).to.equal(this.name); + expect(await upgraded.v2()).to.equal("hi"); + expect(await upgraded.balanceOf(recipient)).to.equal(transferAmount); + expect(await upgraded.transactionsSize()).to.equal(1); + await upgraded.addTransaction(mockDownstream.address, data); + expect(await upgraded.transactionsSize()).to.equal(2); + }); + }); + + + + describe("Wrapping", async function () { + it("should wrap inital tokens", async function () { + const stakedToken: StakedToken = this.stakedToken; + const wrapper: Wrapper = this.wrapper; + const userAddress = await _signers[1].getAddress(); + + }); + + +} diff --git a/test/Wrapper.ts b/test/Wrapper.ts new file mode 100644 index 0000000..910093d --- /dev/null +++ b/test/Wrapper.ts @@ -0,0 +1,53 @@ +import chai from "chai"; +import { Signer } from "@ethersproject/abstract-signer"; +import { deployContract, solidity } from "ethereum-waffle"; +import { ethers, upgrades } from "hardhat"; + +import MockDownstreamArtifact from "../artifacts/contracts/mocks/MockDownstream.sol/MockDownstream.json"; + +import { StakedToken } from "../typechain/StakedToken"; +import { Wrapper } from "../typechain/Wrapper"; +import { MockDownstream } from "../typechain/MockDownstream"; +import { shouldBehaveLikeStakedToken } from "./StakedToken.behavior"; +import { Contract, ContractFactory } from "ethers"; + +chai.use(solidity); + +setTimeout(async function () { + const signers: Signer[] = await ethers.getSigners(); + const admin: Signer = signers[0]; + const decimals = 18; + const decimalsMultiplier = ethers.BigNumber.from(10).pow(decimals); + + describe("StakedToken", function () { + beforeEach(async function () { + this.name = "stakedTST"; + this.symbol = "stTST"; + this.decimals = decimals; + this.decimalsMultiplier = decimalsMultiplier; + // A token with 18 decimals, current supply of 10^15 and anticipated 10^6 maximum possible increase in supply (far exceeds any exisitng token) + this.maxSupply = ethers.BigNumber.from(10).pow(15 + decimals + 6); + this.initialSupply = ethers.BigNumber.from(1000).mul(this.decimalsMultiplier); + + + const StakedToken: ContractFactory = await ethers.getContractFactory("StakedToken"); + const stakedToken: Contract = await upgrades.deployProxy(StakedToken, [this.name, this.symbol, this.decimals, this.maxSupply, this.initialSupply]); + await stakedToken.deployed(); + this.stakedToken = stakedToken as StakedToken; + + + this.wrapperSymbol = "wstTST"; + this.wrapperName = "wrappedStakedTST"; + const Wrapper: ContractFactory = await ethers.getContractFactory("Wrapper"); + const wrapper: Contract = await upgrades.deployProxy(Wrapper, [this.stakedToken, this.wrapperName, this.wrapperSymbol]); + await wrapper.deployed(); + this.wrapper = wrapper as Wrapper; + + this.mockDownstream = (await deployContract(admin, MockDownstreamArtifact, [])) as MockDownstream; + }); + + shouldBehaveLikeStakedToken(signers, decimalsMultiplier); + }); + + run(); +}, 1000); diff --git a/yarn.lock b/yarn.lock index 4fbafcf..64a9df1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1583,6 +1583,11 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-ethereum-package/-/contracts-ethereum-package-3.0.0.tgz#d5db971a177c3b37733db2ee4ebdb79c67575d64" integrity sha512-Xg33RtX7FGbSK/YnroLhcGNAvH30/C84NRW8KvbSdXXYiLA8YqM1bOA9sAeLjmQxXqYUn/YL4AUVTgDnG51NOw== +"@openzeppelin/contracts-upgradeable@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.1.0.tgz#36a6113ceeda278ae14f740280e5388161dfd383" + integrity sha512-QZSvbYqNpU/x60vARhq/jghh97VWjml3NAlKfu4u1XehvpEBbHVXJyKTBSZtZY7jviG305jOczEisnN8VeOMcw== + "@openzeppelin/contracts@^3.2.0": version "3.4.1" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.1.tgz#03c891fec7f93be0ae44ed74e57a122a38732ce7"