@ensuro/core 2.0.0-beta8 → 2.0.0-beta9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -14
- package/build/contracts/AccessManager.sol/AccessManager.json +2 -2
- package/build/contracts/ERC4626AssetManager.sol/ERC4626AssetManager.json +9 -3
- package/build/contracts/EToken.sol/EToken.json +2 -15
- package/build/contracts/LPManualWhitelist.sol/LPManualWhitelist.json +2 -2
- package/build/contracts/LiquidityThresholdAssetManager.sol/LiquidityThresholdAssetManager.json +7 -1
- package/build/contracts/Policy.sol/Policy.json +2 -2
- package/build/contracts/PolicyPool.sol/PolicyPool.json +21 -2
- package/build/contracts/PremiumsAccount.sol/PremiumsAccount.json +2 -15
- package/build/contracts/Reserve.sol/Reserve.json +0 -13
- package/build/contracts/TimeScaled.sol/TimeScaled.json +3 -17
- package/build/contracts/TrustfulRiskModule.sol/TrustfulRiskModule.json +2 -2
- package/build/contracts/{WadRayMath.sol → dependencies/WadRayMath.sol}/WadRayMath.json +3 -3
- package/build/contracts/interfaces/IAssetManager.sol/IAssetManager.json +7 -1
- package/build/contracts/interfaces/IPolicyPool.sol/IPolicyPool.json +19 -0
- package/build/contracts/mocks/FixedRateVault.sol/FixedRateVault.json +2 -2
- package/build/contracts/mocks/ForwardProxy.sol/ForwardProxy.json +2 -2
- package/build/contracts/mocks/PolicyHolderMock.sol/PolicyHolderMock.json +28 -2
- package/build/contracts/mocks/PolicyPoolComponentMock.sol/PolicyPoolComponentMock.json +2 -2
- package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMock.json +96 -2
- package/build/contracts/mocks/PolicyPoolMock.sol/PolicyPoolMockForward.json +2 -2
- package/build/contracts/mocks/RiskModuleMock.sol/RiskModuleMock.json +92 -2
- package/build/contracts/mocks/TestCurrency.sol/TestCurrency.json +2 -2
- package/build/contracts/mocks/TestNFT.sol/TestNFT.json +2 -2
- package/contracts/AccessManager.sol +1 -1
- package/contracts/ERC4626AssetManager.sol +5 -2
- package/contracts/EToken.sol +43 -44
- package/contracts/LiquidityThresholdAssetManager.sol +11 -10
- package/contracts/Policy.sol +1 -1
- package/contracts/PolicyPool.sol +152 -19
- package/contracts/PolicyPoolComponent.sol +7 -22
- package/contracts/PremiumsAccount.sol +159 -19
- package/contracts/Reserve.sol +112 -17
- package/contracts/RiskModule.sol +8 -8
- package/contracts/TimeScaled.sol +19 -15
- package/contracts/TrustfulRiskModule.sol +3 -3
- package/contracts/dependencies/WadRayMath.sol +126 -0
- package/contracts/interfaces/IAccessManager.sol +68 -13
- package/contracts/interfaces/IAssetManager.sol +63 -1
- package/contracts/interfaces/IEToken.sol +4 -1
- package/contracts/interfaces/ILPWhitelist.sol +17 -0
- package/contracts/interfaces/IPolicyPool.sol +7 -0
- package/contracts/interfaces/IPolicyPoolComponent.sol +3 -0
- package/contracts/interfaces/IRiskModule.sol +67 -4
- package/contracts/mocks/PolicyHolderMock.sol +21 -0
- package/contracts/mocks/PolicyPoolMock.sol +27 -0
- package/contracts/mocks/RiskModuleMock.sol +7 -1
- package/js/test-utils.js +49 -36
- package/package.json +1 -1
- package/contracts/WadRayMath.sol +0 -135
|
@@ -381,8 +381,8 @@
|
|
|
381
381
|
"type": "function"
|
|
382
382
|
}
|
|
383
383
|
],
|
|
384
|
-
"bytecode": "0x60806040523480156200001157600080fd5b506040516200169a3803806200169a8339810160408190526200003491620001de565b8151829082906200004d90600090602085019062000081565b5080516200006390600190602084019062000081565b5050600680546001600160a01b03191633179055506200029b915050565b8280546200008f9062000248565b90600052602060002090601f016020900481019282620000b35760008555620000fe565b82601f10620000ce57805160ff1916838001178555620000fe565b82800160010185558215620000fe579182015b82811115620000fe578251825591602001919060010190620000e1565b506200010c92915062000110565b5090565b5b808211156200010c576000815560010162000111565b600082601f8301126200013957600080fd5b81516001600160401b038082111562000156576200015662000285565b604051601f8301601f19908116603f0116810190828211818310171562000181576200018162000285565b816040528381526020925086838588010111156200019e57600080fd5b600091505b83821015620001c25785820183015181830184015290820190620001a3565b83821115620001d45760008385830101525b9695505050505050565b60008060408385031215620001f257600080fd5b82516001600160401b03808211156200020a57600080fd5b620002188683870162000127565b935060208501519150808211156200022f57600080fd5b506200023e8582860162000127565b9150509250929050565b600181811c908216806200025d57607f821691505b602082108114156200027f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b6113ef80620002ab6000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806342966c6811610097578063a22cb46511610066578063a22cb465146101ff578063b88d4fde14610212578063c87b56dd14610225578063e985e9c51461023857600080fd5b806342966c68146101b05780636352211e146101c357806370a08231146101d657806395d89b41146101f757600080fd5b8063095ea7b3116100d3578063095ea7b31461016257806323b872dd1461017757806340c10f191461018a57806342842e0e1461019d57600080fd5b806301ffc9a7146100fa57806306fdde0314610122578063081812fc14610137575b600080fd5b61010d6101083660046110d4565b610274565b60405190151581526020015b60405180910390f35b61012a6102c6565b60405161011991906111bf565b61014a61014536600461110e565b610358565b6040516001600160a01b039091168152602001610119565b6101756101703660046110aa565b61037f565b005b610175610185366004610f56565b61049a565b6101756101983660046110aa565b6104cb565b6101756101ab366004610f56565b6104d9565b6101756101be36600461110e565b6104f4565b61014a6101d136600461110e565b61056e565b6101e96101e4366004610f08565b6105ce565b604051908152602001610119565b61012a610654565b61017561020d36600461106e565b610663565b610175610220366004610f92565b61066e565b61012a61023336600461110e565b6106a6565b61010d610246366004610f23565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006001600160e01b031982166380ac58cd60e01b14806102a557506001600160e01b03198216635b5e139f60e01b145b806102c057506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546102d5906112e1565b80601f0160208091040260200160405190810160405280929190818152602001828054610301906112e1565b801561034e5780601f106103235761010080835404028352916020019161034e565b820191906000526020600020905b81548152906001019060200180831161033157829003601f168201915b5050505050905090565b60006103638261071a565b506000908152600460205260409020546001600160a01b031690565b600061038a8261056e565b9050806001600160a01b0316836001600160a01b031614156103fd5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061041957506104198133610246565b61048b5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016103f4565b6104958383610779565b505050565b6104a433826107e7565b6104c05760405162461bcd60e51b81526004016103f490611224565b610495838383610866565b6104d58282610a02565b5050565b6104958383836040518060200160405280600081525061066e565b336104fe8261056e565b6001600160a01b0316146105625760405162461bcd60e51b815260206004820152602560248201527f4552433732313a206275726e206f6620746f6b656e2074686174206973206e6f6044820152643a1037bbb760d91b60648201526084016103f4565b61056b81610b44565b50565b6000818152600260205260408120546001600160a01b0316806102c05760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103f4565b60006001600160a01b0382166106385760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103f4565b506001600160a01b031660009081526003602052604090205490565b6060600180546102d5906112e1565b6104d5338383610bdf565b61067833836107e7565b6106945760405162461bcd60e51b81526004016103f490611224565b6106a084848484610cae565b50505050565b60606106b18261071a565b60006106c860408051602081019091526000815290565b905060008151116106e85760405180602001604052806000815250610713565b806106f284610ce1565b604051602001610703929190611153565b6040516020818303038152906040525b9392505050565b6000818152600260205260409020546001600160a01b031661056b5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103f4565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906107ae8261056e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806107f38361056e565b9050806001600160a01b0316846001600160a01b0316148061083a57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061085e5750836001600160a01b031661085384610358565b6001600160a01b0316145b949350505050565b826001600160a01b03166108798261056e565b6001600160a01b0316146108dd5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016103f4565b6001600160a01b03821661093f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016103f4565b61094a600082610779565b6001600160a01b038316600090815260036020526040812080546001929061097390849061129e565b90915550506001600160a01b03821660009081526003602052604081208054600192906109a1908490611272565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216610a585760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103f4565b6000818152600260205260409020546001600160a01b031615610abd5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016103f4565b6001600160a01b0382166000908152600360205260408120805460019290610ae6908490611272565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000610b4f8261056e565b9050610b5c600083610779565b6001600160a01b0381166000908152600360205260408120805460019290610b8590849061129e565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b816001600160a01b0316836001600160a01b03161415610c415760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016103f4565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610cb9848484610866565b610cc584848484610ddf565b6106a05760405162461bcd60e51b81526004016103f4906111d2565b606081610d055750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610d2f5780610d198161131c565b9150610d289050600a8361128a565b9150610d09565b60008167ffffffffffffffff811115610d4a57610d4a61138d565b6040519080825280601f01601f191660200182016040528015610d74576020820181803683370190505b5090505b841561085e57610d8960018361129e565b9150610d96600a86611337565b610da1906030611272565b60f81b818381518110610db657610db6611377565b60200101906001600160f81b031916908160001a905350610dd8600a8661128a565b9450610d78565b60006001600160a01b0384163b15610ee157604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610e23903390899088908890600401611182565b602060405180830381600087803b158015610e3d57600080fd5b505af1925050508015610e6d575060408051601f3d908101601f19168201909252610e6a918101906110f1565b60015b610ec7573d808015610e9b576040519150601f19603f3d011682016040523d82523d6000602084013e610ea0565b606091505b508051610ebf5760405162461bcd60e51b81526004016103f4906111d2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061085e565b506001949350505050565b80356001600160a01b0381168114610f0357600080fd5b919050565b600060208284031215610f1a57600080fd5b61071382610eec565b60008060408385031215610f3657600080fd5b610f3f83610eec565b9150610f4d60208401610eec565b90509250929050565b600080600060608486031215610f6b57600080fd5b610f7484610eec565b9250610f8260208501610eec565b9150604084013590509250925092565b60008060008060808587031215610fa857600080fd5b610fb185610eec565b9350610fbf60208601610eec565b925060408501359150606085013567ffffffffffffffff80821115610fe357600080fd5b818701915087601f830112610ff757600080fd5b8135818111156110095761100961138d565b604051601f8201601f19908116603f011681019083821181831017156110315761103161138d565b816040528281528a602084870101111561104a57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561108157600080fd5b61108a83610eec565b91506020830135801515811461109f57600080fd5b809150509250929050565b600080604083850312156110bd57600080fd5b6110c683610eec565b946020939093013593505050565b6000602082840312156110e657600080fd5b8135610713816113a3565b60006020828403121561110357600080fd5b8151610713816113a3565b60006020828403121561112057600080fd5b5035919050565b6000815180845261113f8160208601602086016112b5565b601f01601f19169290920160200192915050565b600083516111658184602088016112b5565b8351908301906111798183602088016112b5565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906111b590830184611127565b9695505050505050565b6020815260006107136020830184611127565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b600082198211156112855761128561134b565b500190565b60008261129957611299611361565b500490565b6000828210156112b0576112b061134b565b500390565b60005b838110156112d05781810151838201526020016112b8565b838111156106a05750506000910152565b600181811c908216806112f557607f821691505b6020821081141561131657634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156113305761133061134b565b5060010190565b60008261134657611346611361565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461056b57600080fdfea264697066735822122009ec0be20bb17f8e9b57fc7dd6c9862c50e6fc5c774d5853cdf1fe4f2d3e830c64736f6c63430008060033",
|
|
385
|
-
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806342966c6811610097578063a22cb46511610066578063a22cb465146101ff578063b88d4fde14610212578063c87b56dd14610225578063e985e9c51461023857600080fd5b806342966c68146101b05780636352211e146101c357806370a08231146101d657806395d89b41146101f757600080fd5b8063095ea7b3116100d3578063095ea7b31461016257806323b872dd1461017757806340c10f191461018a57806342842e0e1461019d57600080fd5b806301ffc9a7146100fa57806306fdde0314610122578063081812fc14610137575b600080fd5b61010d6101083660046110d4565b610274565b60405190151581526020015b60405180910390f35b61012a6102c6565b60405161011991906111bf565b61014a61014536600461110e565b610358565b6040516001600160a01b039091168152602001610119565b6101756101703660046110aa565b61037f565b005b610175610185366004610f56565b61049a565b6101756101983660046110aa565b6104cb565b6101756101ab366004610f56565b6104d9565b6101756101be36600461110e565b6104f4565b61014a6101d136600461110e565b61056e565b6101e96101e4366004610f08565b6105ce565b604051908152602001610119565b61012a610654565b61017561020d36600461106e565b610663565b610175610220366004610f92565b61066e565b61012a61023336600461110e565b6106a6565b61010d610246366004610f23565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b60006001600160e01b031982166380ac58cd60e01b14806102a557506001600160e01b03198216635b5e139f60e01b145b806102c057506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546102d5906112e1565b80601f0160208091040260200160405190810160405280929190818152602001828054610301906112e1565b801561034e5780601f106103235761010080835404028352916020019161034e565b820191906000526020600020905b81548152906001019060200180831161033157829003601f168201915b5050505050905090565b60006103638261071a565b506000908152600460205260409020546001600160a01b031690565b600061038a8261056e565b9050806001600160a01b0316836001600160a01b031614156103fd5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061041957506104198133610246565b61048b5760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016103f4565b6104958383610779565b505050565b6104a433826107e7565b6104c05760405162461bcd60e51b81526004016103f490611224565b610495838383610866565b6104d58282610a02565b5050565b6104958383836040518060200160405280600081525061066e565b336104fe8261056e565b6001600160a01b0316146105625760405162461bcd60e51b815260206004820152602560248201527f4552433732313a206275726e206f6620746f6b656e2074686174206973206e6f6044820152643a1037bbb760d91b60648201526084016103f4565b61056b81610b44565b50565b6000818152600260205260408120546001600160a01b0316806102c05760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103f4565b60006001600160a01b0382166106385760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103f4565b506001600160a01b031660009081526003602052604090205490565b6060600180546102d5906112e1565b6104d5338383610bdf565b61067833836107e7565b6106945760405162461bcd60e51b81526004016103f490611224565b6106a084848484610cae565b50505050565b60606106b18261071a565b60006106c860408051602081019091526000815290565b905060008151116106e85760405180602001604052806000815250610713565b806106f284610ce1565b604051602001610703929190611153565b6040516020818303038152906040525b9392505050565b6000818152600260205260409020546001600160a01b031661056b5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103f4565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906107ae8261056e565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806107f38361056e565b9050806001600160a01b0316846001600160a01b0316148061083a57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061085e5750836001600160a01b031661085384610358565b6001600160a01b0316145b949350505050565b826001600160a01b03166108798261056e565b6001600160a01b0316146108dd5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016103f4565b6001600160a01b03821661093f5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016103f4565b61094a600082610779565b6001600160a01b038316600090815260036020526040812080546001929061097390849061129e565b90915550506001600160a01b03821660009081526003602052604081208054600192906109a1908490611272565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216610a585760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103f4565b6000818152600260205260409020546001600160a01b031615610abd5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016103f4565b6001600160a01b0382166000908152600360205260408120805460019290610ae6908490611272565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000610b4f8261056e565b9050610b5c600083610779565b6001600160a01b0381166000908152600360205260408120805460019290610b8590849061129e565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b816001600160a01b0316836001600160a01b03161415610c415760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016103f4565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610cb9848484610866565b610cc584848484610ddf565b6106a05760405162461bcd60e51b81526004016103f4906111d2565b606081610d055750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610d2f5780610d198161131c565b9150610d289050600a8361128a565b9150610d09565b60008167ffffffffffffffff811115610d4a57610d4a61138d565b6040519080825280601f01601f191660200182016040528015610d74576020820181803683370190505b5090505b841561085e57610d8960018361129e565b9150610d96600a86611337565b610da1906030611272565b60f81b818381518110610db657610db6611377565b60200101906001600160f81b031916908160001a905350610dd8600a8661128a565b9450610d78565b60006001600160a01b0384163b15610ee157604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610e23903390899088908890600401611182565b602060405180830381600087803b158015610e3d57600080fd5b505af1925050508015610e6d575060408051601f3d908101601f19168201909252610e6a918101906110f1565b60015b610ec7573d808015610e9b576040519150601f19603f3d011682016040523d82523d6000602084013e610ea0565b606091505b508051610ebf5760405162461bcd60e51b81526004016103f4906111d2565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061085e565b506001949350505050565b80356001600160a01b0381168114610f0357600080fd5b919050565b600060208284031215610f1a57600080fd5b61071382610eec565b60008060408385031215610f3657600080fd5b610f3f83610eec565b9150610f4d60208401610eec565b90509250929050565b600080600060608486031215610f6b57600080fd5b610f7484610eec565b9250610f8260208501610eec565b9150604084013590509250925092565b60008060008060808587031215610fa857600080fd5b610fb185610eec565b9350610fbf60208601610eec565b925060408501359150606085013567ffffffffffffffff80821115610fe357600080fd5b818701915087601f830112610ff757600080fd5b8135818111156110095761100961138d565b604051601f8201601f19908116603f011681019083821181831017156110315761103161138d565b816040528281528a602084870101111561104a57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561108157600080fd5b61108a83610eec565b91506020830135801515811461109f57600080fd5b809150509250929050565b600080604083850312156110bd57600080fd5b6110c683610eec565b946020939093013593505050565b6000602082840312156110e657600080fd5b8135610713816113a3565b60006020828403121561110357600080fd5b8151610713816113a3565b60006020828403121561112057600080fd5b5035919050565b6000815180845261113f8160208601602086016112b5565b601f01601f19169290920160200192915050565b600083516111658184602088016112b5565b8351908301906111798183602088016112b5565b01949350505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906111b590830184611127565b9695505050505050565b6020815260006107136020830184611127565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b600082198211156112855761128561134b565b500190565b60008261129957611299611361565b500490565b6000828210156112b0576112b061134b565b500390565b60005b838110156112d05781810151838201526020016112b8565b838111156106a05750506000910152565b600181811c908216806112f557607f821691505b6020821081141561131657634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156113305761133061134b565b5060010190565b60008261134657611346611361565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461056b57600080fdfea264697066735822122009ec0be20bb17f8e9b57fc7dd6c9862c50e6fc5c774d5853cdf1fe4f2d3e830c64736f6c63430008060033",
|
|
384
|
+
"bytecode": "0x60806040523480156200001157600080fd5b50604051620016c0380380620016c0833981016040819052620000349162000136565b818160006200004483826200022f565b5060016200005382826200022f565b5050600680546001600160a01b0319163317905550620002fb915050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200009957600080fd5b81516001600160401b0380821115620000b657620000b662000071565b604051601f8301601f19908116603f01168101908282118183101715620000e157620000e162000071565b81604052838152602092508683858801011115620000fe57600080fd5b600091505b8382101562000122578582018301518183018401529082019062000103565b600093810190920192909252949350505050565b600080604083850312156200014a57600080fd5b82516001600160401b03808211156200016257600080fd5b620001708683870162000087565b935060208501519150808211156200018757600080fd5b50620001968582860162000087565b9150509250929050565b600181811c90821680620001b557607f821691505b602082108103620001d657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200022a57600081815260208120601f850160051c81016020861015620002055750805b601f850160051c820191505b81811015620002265782815560010162000211565b5050505b505050565b81516001600160401b038111156200024b576200024b62000071565b62000263816200025c8454620001a0565b84620001dc565b602080601f8311600181146200029b5760008415620002825750858301515b600019600386901b1c1916600185901b17855562000226565b600085815260208120601f198616915b82811015620002cc57888601518255948401946001909101908401620002ab565b5085821015620002eb5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6113b5806200030b6000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806342966c6811610097578063a22cb46511610066578063a22cb465146101ff578063b88d4fde14610212578063c87b56dd14610225578063e985e9c51461023857600080fd5b806342966c68146101b05780636352211e146101c357806370a08231146101d657806395d89b41146101f757600080fd5b8063095ea7b3116100d3578063095ea7b31461016257806323b872dd1461017757806340c10f191461018a57806342842e0e1461019d57600080fd5b806301ffc9a7146100fa57806306fdde0314610122578063081812fc14610137575b600080fd5b61010d610108366004610edc565b61024b565b60405190151581526020015b60405180910390f35b61012a61029d565b6040516101199190610f49565b61014a610145366004610f5c565b61032f565b6040516001600160a01b039091168152602001610119565b610175610170366004610f91565b610356565b005b610175610185366004610fbb565b610470565b610175610198366004610f91565b6104a1565b6101756101ab366004610fbb565b6104af565b6101756101be366004610f5c565b6104ca565b61014a6101d1366004610f5c565b610544565b6101e96101e4366004610ff7565b6105a4565b604051908152602001610119565b61012a61062a565b61017561020d366004611012565b610639565b610175610220366004611064565b610644565b61012a610233366004610f5c565b61067c565b61010d610246366004611140565b6106f0565b60006001600160e01b031982166380ac58cd60e01b148061027c57506001600160e01b03198216635b5e139f60e01b145b8061029757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546102ac90611173565b80601f01602080910402602001604051908101604052809291908181526020018280546102d890611173565b80156103255780601f106102fa57610100808354040283529160200191610325565b820191906000526020600020905b81548152906001019060200180831161030857829003601f168201915b5050505050905090565b600061033a8261071e565b506000908152600460205260409020546001600160a01b031690565b600061036182610544565b9050806001600160a01b0316836001600160a01b0316036103d35760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806103ef57506103ef81336106f0565b6104615760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016103ca565b61046b838361077d565b505050565b61047a33826107eb565b6104965760405162461bcd60e51b81526004016103ca906111ad565b61046b83838361084a565b6104ab82826109e6565b5050565b61046b83838360405180602001604052806000815250610644565b336104d482610544565b6001600160a01b0316146105385760405162461bcd60e51b815260206004820152602560248201527f4552433732313a206275726e206f6620746f6b656e2074686174206973206e6f6044820152643a1037bbb760d91b60648201526084016103ca565b61054181610b28565b50565b6000818152600260205260408120546001600160a01b0316806102975760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103ca565b60006001600160a01b03821661060e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103ca565b506001600160a01b031660009081526003602052604090205490565b6060600180546102ac90611173565b6104ab338383610bc3565b61064e33836107eb565b61066a5760405162461bcd60e51b81526004016103ca906111ad565b61067684848484610c91565b50505050565b60606106878261071e565b600061069e60408051602081019091526000815290565b905060008151116106be57604051806020016040528060008152506106e9565b806106c884610cc4565b6040516020016106d99291906111fb565b6040516020818303038152906040525b9392505050565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6000818152600260205260409020546001600160a01b03166105415760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103ca565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906107b282610544565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806107f783610544565b9050806001600160a01b0316846001600160a01b0316148061081e575061081e81856106f0565b806108425750836001600160a01b03166108378461032f565b6001600160a01b0316145b949350505050565b826001600160a01b031661085d82610544565b6001600160a01b0316146108c15760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016103ca565b6001600160a01b0382166109235760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016103ca565b61092e60008261077d565b6001600160a01b0383166000908152600360205260408120805460019290610957908490611240565b90915550506001600160a01b0382166000908152600360205260408120805460019290610985908490611253565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216610a3c5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103ca565b6000818152600260205260409020546001600160a01b031615610aa15760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016103ca565b6001600160a01b0382166000908152600360205260408120805460019290610aca908490611253565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000610b3382610544565b9050610b4060008361077d565b6001600160a01b0381166000908152600360205260408120805460019290610b69908490611240565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b816001600160a01b0316836001600160a01b031603610c245760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016103ca565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610c9c84848461084a565b610ca884848484610dc5565b6106765760405162461bcd60e51b81526004016103ca90611266565b606081600003610ceb5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610d155780610cff816112b8565b9150610d0e9050600a836112e7565b9150610cef565b60008167ffffffffffffffff811115610d3057610d3061104e565b6040519080825280601f01601f191660200182016040528015610d5a576020820181803683370190505b5090505b841561084257610d6f600183611240565b9150610d7c600a866112fb565b610d87906030611253565b60f81b818381518110610d9c57610d9c61130f565b60200101906001600160f81b031916908160001a905350610dbe600a866112e7565b9450610d5e565b60006001600160a01b0384163b15610ebb57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610e09903390899088908890600401611325565b6020604051808303816000875af1925050508015610e44575060408051601f3d908101601f19168201909252610e4191810190611362565b60015b610ea1573d808015610e72576040519150601f19603f3d011682016040523d82523d6000602084013e610e77565b606091505b508051600003610e995760405162461bcd60e51b81526004016103ca90611266565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610842565b506001949350505050565b6001600160e01b03198116811461054157600080fd5b600060208284031215610eee57600080fd5b81356106e981610ec6565b60005b83811015610f14578181015183820152602001610efc565b50506000910152565b60008151808452610f35816020860160208601610ef9565b601f01601f19169290920160200192915050565b6020815260006106e96020830184610f1d565b600060208284031215610f6e57600080fd5b5035919050565b80356001600160a01b0381168114610f8c57600080fd5b919050565b60008060408385031215610fa457600080fd5b610fad83610f75565b946020939093013593505050565b600080600060608486031215610fd057600080fd5b610fd984610f75565b9250610fe760208501610f75565b9150604084013590509250925092565b60006020828403121561100957600080fd5b6106e982610f75565b6000806040838503121561102557600080fd5b61102e83610f75565b91506020830135801515811461104357600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561107a57600080fd5b61108385610f75565b935061109160208601610f75565b925060408501359150606085013567ffffffffffffffff808211156110b557600080fd5b818701915087601f8301126110c957600080fd5b8135818111156110db576110db61104e565b604051601f8201601f19908116603f011681019083821181831017156111035761110361104e565b816040528281528a602084870101111561111c57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561115357600080fd5b61115c83610f75565b915061116a60208401610f75565b90509250929050565b600181811c9082168061118757607f821691505b6020821081036111a757634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6000835161120d818460208801610ef9565b835190830190611221818360208801610ef9565b01949350505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156102975761029761122a565b808201808211156102975761029761122a565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000600182016112ca576112ca61122a565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826112f6576112f66112d1565b500490565b60008261130a5761130a6112d1565b500690565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061135890830184610f1d565b9695505050505050565b60006020828403121561137457600080fd5b81516106e981610ec656fea26469706673582212202d84d1f6a57fa94433606062762f4bb27bfb75ba859a759da03f33de4fa46cde64736f6c63430008100033",
|
|
385
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806342966c6811610097578063a22cb46511610066578063a22cb465146101ff578063b88d4fde14610212578063c87b56dd14610225578063e985e9c51461023857600080fd5b806342966c68146101b05780636352211e146101c357806370a08231146101d657806395d89b41146101f757600080fd5b8063095ea7b3116100d3578063095ea7b31461016257806323b872dd1461017757806340c10f191461018a57806342842e0e1461019d57600080fd5b806301ffc9a7146100fa57806306fdde0314610122578063081812fc14610137575b600080fd5b61010d610108366004610edc565b61024b565b60405190151581526020015b60405180910390f35b61012a61029d565b6040516101199190610f49565b61014a610145366004610f5c565b61032f565b6040516001600160a01b039091168152602001610119565b610175610170366004610f91565b610356565b005b610175610185366004610fbb565b610470565b610175610198366004610f91565b6104a1565b6101756101ab366004610fbb565b6104af565b6101756101be366004610f5c565b6104ca565b61014a6101d1366004610f5c565b610544565b6101e96101e4366004610ff7565b6105a4565b604051908152602001610119565b61012a61062a565b61017561020d366004611012565b610639565b610175610220366004611064565b610644565b61012a610233366004610f5c565b61067c565b61010d610246366004611140565b6106f0565b60006001600160e01b031982166380ac58cd60e01b148061027c57506001600160e01b03198216635b5e139f60e01b145b8061029757506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600080546102ac90611173565b80601f01602080910402602001604051908101604052809291908181526020018280546102d890611173565b80156103255780601f106102fa57610100808354040283529160200191610325565b820191906000526020600020905b81548152906001019060200180831161030857829003601f168201915b5050505050905090565b600061033a8261071e565b506000908152600460205260409020546001600160a01b031690565b600061036182610544565b9050806001600160a01b0316836001600160a01b0316036103d35760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b03821614806103ef57506103ef81336106f0565b6104615760405162461bcd60e51b815260206004820152603e60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206e6f7220617070726f76656420666f7220616c6c000060648201526084016103ca565b61046b838361077d565b505050565b61047a33826107eb565b6104965760405162461bcd60e51b81526004016103ca906111ad565b61046b83838361084a565b6104ab82826109e6565b5050565b61046b83838360405180602001604052806000815250610644565b336104d482610544565b6001600160a01b0316146105385760405162461bcd60e51b815260206004820152602560248201527f4552433732313a206275726e206f6620746f6b656e2074686174206973206e6f6044820152643a1037bbb760d91b60648201526084016103ca565b61054181610b28565b50565b6000818152600260205260408120546001600160a01b0316806102975760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103ca565b60006001600160a01b03821661060e5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b60648201526084016103ca565b506001600160a01b031660009081526003602052604090205490565b6060600180546102ac90611173565b6104ab338383610bc3565b61064e33836107eb565b61066a5760405162461bcd60e51b81526004016103ca906111ad565b61067684848484610c91565b50505050565b60606106878261071e565b600061069e60408051602081019091526000815290565b905060008151116106be57604051806020016040528060008152506106e9565b806106c884610cc4565b6040516020016106d99291906111fb565b6040516020818303038152906040525b9392505050565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6000818152600260205260409020546001600160a01b03166105415760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b60448201526064016103ca565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906107b282610544565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806107f783610544565b9050806001600160a01b0316846001600160a01b0316148061081e575061081e81856106f0565b806108425750836001600160a01b03166108378461032f565b6001600160a01b0316145b949350505050565b826001600160a01b031661085d82610544565b6001600160a01b0316146108c15760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b60648201526084016103ca565b6001600160a01b0382166109235760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b60648201526084016103ca565b61092e60008261077d565b6001600160a01b0383166000908152600360205260408120805460019290610957908490611240565b90915550506001600160a01b0382166000908152600360205260408120805460019290610985908490611253565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216610a3c5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016103ca565b6000818152600260205260409020546001600160a01b031615610aa15760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016103ca565b6001600160a01b0382166000908152600360205260408120805460019290610aca908490611253565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000610b3382610544565b9050610b4060008361077d565b6001600160a01b0381166000908152600360205260408120805460019290610b69908490611240565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b816001600160a01b0316836001600160a01b031603610c245760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016103ca565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b610c9c84848461084a565b610ca884848484610dc5565b6106765760405162461bcd60e51b81526004016103ca90611266565b606081600003610ceb5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115610d155780610cff816112b8565b9150610d0e9050600a836112e7565b9150610cef565b60008167ffffffffffffffff811115610d3057610d3061104e565b6040519080825280601f01601f191660200182016040528015610d5a576020820181803683370190505b5090505b841561084257610d6f600183611240565b9150610d7c600a866112fb565b610d87906030611253565b60f81b818381518110610d9c57610d9c61130f565b60200101906001600160f81b031916908160001a905350610dbe600a866112e7565b9450610d5e565b60006001600160a01b0384163b15610ebb57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290610e09903390899088908890600401611325565b6020604051808303816000875af1925050508015610e44575060408051601f3d908101601f19168201909252610e4191810190611362565b60015b610ea1573d808015610e72576040519150601f19603f3d011682016040523d82523d6000602084013e610e77565b606091505b508051600003610e995760405162461bcd60e51b81526004016103ca90611266565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050610842565b506001949350505050565b6001600160e01b03198116811461054157600080fd5b600060208284031215610eee57600080fd5b81356106e981610ec6565b60005b83811015610f14578181015183820152602001610efc565b50506000910152565b60008151808452610f35816020860160208601610ef9565b601f01601f19169290920160200192915050565b6020815260006106e96020830184610f1d565b600060208284031215610f6e57600080fd5b5035919050565b80356001600160a01b0381168114610f8c57600080fd5b919050565b60008060408385031215610fa457600080fd5b610fad83610f75565b946020939093013593505050565b600080600060608486031215610fd057600080fd5b610fd984610f75565b9250610fe760208501610f75565b9150604084013590509250925092565b60006020828403121561100957600080fd5b6106e982610f75565b6000806040838503121561102557600080fd5b61102e83610f75565b91506020830135801515811461104357600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000806000806080858703121561107a57600080fd5b61108385610f75565b935061109160208601610f75565b925060408501359150606085013567ffffffffffffffff808211156110b557600080fd5b818701915087601f8301126110c957600080fd5b8135818111156110db576110db61104e565b604051601f8201601f19908116603f011681019083821181831017156111035761110361104e565b816040528281528a602084870101111561111c57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6000806040838503121561115357600080fd5b61115c83610f75565b915061116a60208401610f75565b90509250929050565b600181811c9082168061118757607f821691505b6020821081036111a757634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526d1c881b9bdc88185c1c1c9bdd995960921b606082015260800190565b6000835161120d818460208801610ef9565b835190830190611221818360208801610ef9565b01949350505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156102975761029761122a565b808201808211156102975761029761122a565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000600182016112ca576112ca61122a565b5060010190565b634e487b7160e01b600052601260045260246000fd5b6000826112f6576112f66112d1565b500490565b60008261130a5761130a6112d1565b500690565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061135890830184610f1d565b9695505050505050565b60006020828403121561137457600080fd5b81516106e981610ec656fea26469706673582212202d84d1f6a57fa94433606062762f4bb27bfb75ba859a759da03f33de4fa46cde64736f6c63430008100033",
|
|
386
386
|
"linkReferences": {},
|
|
387
387
|
"deployedLinkReferences": {}
|
|
388
388
|
}
|
|
@@ -32,7 +32,7 @@ contract AccessManager is Initializable, AccessControlUpgradeable, UUPSUpgradeab
|
|
|
32
32
|
|
|
33
33
|
// solhint-disable-next-line func-name-mixedcase
|
|
34
34
|
function __AccessManager_init_unchained() internal initializer {
|
|
35
|
-
_setupRole(DEFAULT_ADMIN_ROLE,
|
|
35
|
+
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// solhint-disable-next-line no-empty-blocks
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";
|
|
5
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
6
6
|
import {IERC4626} from "@openzeppelin/contracts/interfaces/IERC4626.sol";
|
|
7
|
+
import {LiquidityThresholdAssetManager} from "./LiquidityThresholdAssetManager.sol";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @title Asset Manager that deploys the funds into an ERC4626 vault
|
|
@@ -12,6 +13,8 @@ import {IERC4626} from "@openzeppelin/contracts/interfaces/IERC4626.sol";
|
|
|
12
13
|
* @author Ensuro
|
|
13
14
|
*/
|
|
14
15
|
contract ERC4626AssetManager is LiquidityThresholdAssetManager {
|
|
16
|
+
using SafeCast for uint256;
|
|
17
|
+
|
|
15
18
|
IERC4626 internal immutable _vault;
|
|
16
19
|
|
|
17
20
|
constructor(IERC20Metadata asset_, IERC4626 vault_) LiquidityThresholdAssetManager(asset_) {
|
|
@@ -37,7 +40,7 @@ contract ERC4626AssetManager is LiquidityThresholdAssetManager {
|
|
|
37
40
|
DiamondStorage storage ds = diamondStorage();
|
|
38
41
|
uint256 assets = _vault.redeem(_vault.balanceOf(address(this)), address(this), address(this));
|
|
39
42
|
earnings = int256(assets) - int256(uint256(ds.lastInvestmentValue));
|
|
40
|
-
ds.lastInvestmentValue =
|
|
43
|
+
ds.lastInvestmentValue = assets.toUint128();
|
|
41
44
|
emit MoneyDeinvested(assets);
|
|
42
45
|
emit EarningsRecorded(earnings);
|
|
43
46
|
return earnings;
|
package/contracts/EToken.sol
CHANGED
|
@@ -3,6 +3,8 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
5
5
|
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
6
|
+
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";
|
|
7
|
+
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
|
|
6
8
|
import {IPolicyPool} from "./interfaces/IPolicyPool.sol";
|
|
7
9
|
import {Reserve} from "./Reserve.sol";
|
|
8
10
|
import {IEToken} from "./interfaces/IEToken.sol";
|
|
@@ -10,7 +12,7 @@ import {IAccessManager} from "./interfaces/IAccessManager.sol";
|
|
|
10
12
|
import {IPolicyPoolComponent} from "./interfaces/IPolicyPoolComponent.sol";
|
|
11
13
|
import {ILPWhitelist} from "./interfaces/ILPWhitelist.sol";
|
|
12
14
|
import {IAssetManager} from "./interfaces/IAssetManager.sol";
|
|
13
|
-
import {WadRayMath} from "./WadRayMath.sol";
|
|
15
|
+
import {WadRayMath} from "./dependencies/WadRayMath.sol";
|
|
14
16
|
import {TimeScaled} from "./TimeScaled.sol";
|
|
15
17
|
|
|
16
18
|
/**
|
|
@@ -27,8 +29,7 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
27
29
|
using WadRayMath for uint256;
|
|
28
30
|
using TimeScaled for TimeScaled.ScaledAmount;
|
|
29
31
|
using SafeERC20 for IERC20Metadata;
|
|
30
|
-
|
|
31
|
-
uint256 internal constant SECONDS_PER_YEAR = 365 days;
|
|
32
|
+
using SafeCast for uint256;
|
|
32
33
|
|
|
33
34
|
// Attributes taken from ERC20
|
|
34
35
|
mapping(address => uint256) private _balances;
|
|
@@ -109,10 +110,10 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
109
110
|
tokenInterestRate: 0
|
|
110
111
|
}); */
|
|
111
112
|
_params = PackedParams({
|
|
112
|
-
maxUtilizationRate:
|
|
113
|
+
maxUtilizationRate: _wadTo4(maxUtilizationRate_),
|
|
113
114
|
liquidityRequirement: 1e4,
|
|
114
115
|
minUtilizationRate: 0,
|
|
115
|
-
internalLoanInterestRate:
|
|
116
|
+
internalLoanInterestRate: _wadTo4(internalLoanInterestRate_),
|
|
116
117
|
whitelist: ILPWhitelist(address(0))
|
|
117
118
|
});
|
|
118
119
|
|
|
@@ -427,9 +428,10 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
427
428
|
uint256 totalSupply_ = this.totalSupply();
|
|
428
429
|
if (totalSupply_ == 0) _scr.tokenInterestRate = 0;
|
|
429
430
|
else {
|
|
430
|
-
_scr.tokenInterestRate =
|
|
431
|
-
|
|
432
|
-
|
|
431
|
+
_scr.tokenInterestRate = uint256(_scr.interestRate)
|
|
432
|
+
.wadMul(uint256(_scr.scr))
|
|
433
|
+
.wadDiv(totalSupply_)
|
|
434
|
+
.toUint64();
|
|
433
435
|
}
|
|
434
436
|
}
|
|
435
437
|
|
|
@@ -459,6 +461,17 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
459
461
|
_assetManager = newAM;
|
|
460
462
|
}
|
|
461
463
|
|
|
464
|
+
// solhint-disable-next-line func-name-mixedcase
|
|
465
|
+
function _4toWad(uint16 value) internal pure returns (uint256) {
|
|
466
|
+
// 4 decimals to Wad (18 decimals)
|
|
467
|
+
return uint256(value) * 1e14;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function _wadTo4(uint256 value) internal pure returns (uint16) {
|
|
471
|
+
// Wad to 4 decimals
|
|
472
|
+
return (value / 1e14).toUint16();
|
|
473
|
+
}
|
|
474
|
+
|
|
462
475
|
function scr() public view virtual override returns (uint256) {
|
|
463
476
|
return uint256(_scr.scr);
|
|
464
477
|
}
|
|
@@ -472,15 +485,15 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
472
485
|
}
|
|
473
486
|
|
|
474
487
|
function liquidityRequirement() public view returns (uint256) {
|
|
475
|
-
return
|
|
488
|
+
return _4toWad(_params.liquidityRequirement);
|
|
476
489
|
}
|
|
477
490
|
|
|
478
491
|
function maxUtilizationRate() public view returns (uint256) {
|
|
479
|
-
return
|
|
492
|
+
return _4toWad(_params.maxUtilizationRate);
|
|
480
493
|
}
|
|
481
494
|
|
|
482
495
|
function minUtilizationRate() public view returns (uint256) {
|
|
483
|
-
return
|
|
496
|
+
return _4toWad(_params.minUtilizationRate);
|
|
484
497
|
}
|
|
485
498
|
|
|
486
499
|
function utilizationRate() public view returns (uint256) {
|
|
@@ -499,17 +512,14 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
499
512
|
);
|
|
500
513
|
_tsScaled.updateScale(tokenInterestRate());
|
|
501
514
|
if (_scr.scr == 0) {
|
|
502
|
-
_scr.scr =
|
|
503
|
-
_scr.interestRate =
|
|
515
|
+
_scr.scr = scrAmount.toUint128();
|
|
516
|
+
_scr.interestRate = policyInterestRate.toUint64();
|
|
504
517
|
} else {
|
|
505
518
|
uint256 origScr = uint256(_scr.scr);
|
|
506
519
|
uint256 newScr = origScr + scrAmount;
|
|
507
|
-
_scr.interestRate =
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
)
|
|
511
|
-
);
|
|
512
|
-
_scr.scr = uint128(newScr);
|
|
520
|
+
_scr.interestRate = (uint256(_scr.interestRate).wadMul(origScr) +
|
|
521
|
+
policyInterestRate.wadMul(scrAmount)).wadDiv(newScr).toUint64();
|
|
522
|
+
_scr.scr = newScr.toUint128();
|
|
513
523
|
}
|
|
514
524
|
emit SCRLocked(policyInterestRate, scrAmount);
|
|
515
525
|
_updateTokenInterestRate();
|
|
@@ -529,12 +539,9 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
529
539
|
} else {
|
|
530
540
|
uint256 origScr = uint256(_scr.scr);
|
|
531
541
|
uint256 newScr = origScr - scrAmount;
|
|
532
|
-
_scr.interestRate =
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
)
|
|
536
|
-
);
|
|
537
|
-
_scr.scr = uint128(newScr);
|
|
542
|
+
_scr.interestRate = (uint256(_scr.interestRate).wadMul(origScr) -
|
|
543
|
+
policyInterestRate.wadMul(scrAmount)).wadDiv(newScr).toUint64();
|
|
544
|
+
_scr.scr = newScr.toUint128();
|
|
538
545
|
}
|
|
539
546
|
emit SCRUnlocked(policyInterestRate, scrAmount);
|
|
540
547
|
_discreteChange(adjustment);
|
|
@@ -579,11 +586,7 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
579
586
|
onlyPolicyPool
|
|
580
587
|
returns (uint256)
|
|
581
588
|
{
|
|
582
|
-
|
|
583
|
-
if (balance == 0) return 0;
|
|
584
|
-
if (amount > balance) amount = balance;
|
|
585
|
-
uint256 withdrawable = totalWithdrawable();
|
|
586
|
-
if (amount > withdrawable) amount = withdrawable;
|
|
589
|
+
amount = Math.min(amount, Math.min(balanceOf(provider), totalWithdrawable()));
|
|
587
590
|
if (amount == 0) return 0;
|
|
588
591
|
_burn(provider, amount);
|
|
589
592
|
_updateTokenInterestRate();
|
|
@@ -611,12 +614,11 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
611
614
|
bool fromAvailable
|
|
612
615
|
) external override onlyBorrower whenNotPaused returns (uint256) {
|
|
613
616
|
uint256 amountAsked = amount;
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
}
|
|
617
|
+
amount = Math.min(
|
|
618
|
+
Math.min(amount, fromAvailable ? fundsAvailable() : totalSupply()),
|
|
619
|
+
_tsScaled.maxNegativeAdjustment(tokenInterestRate())
|
|
620
|
+
);
|
|
621
|
+
if (amount == 0) return amountAsked;
|
|
620
622
|
TimeScaled.ScaledAmount storage loan = _loans[_msgSender()];
|
|
621
623
|
loan.add(amount, internalLoanInterestRate());
|
|
622
624
|
_discreteChange(-int256(amount));
|
|
@@ -637,12 +639,11 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
637
639
|
|
|
638
640
|
function getLoan(address borrower) public view virtual override returns (uint256) {
|
|
639
641
|
TimeScaled.ScaledAmount storage loan = _loans[borrower];
|
|
640
|
-
if (loan.scale == 0) return 0;
|
|
641
642
|
return loan.getScaledAmount(internalLoanInterestRate());
|
|
642
643
|
}
|
|
643
644
|
|
|
644
645
|
function internalLoanInterestRate() public view returns (uint256) {
|
|
645
|
-
return
|
|
646
|
+
return _4toWad(_params.internalLoanInterestRate);
|
|
646
647
|
}
|
|
647
648
|
|
|
648
649
|
function setParam(Parameter param, uint256 newValue)
|
|
@@ -655,19 +656,19 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
655
656
|
!tweak || _isTweakWad(liquidityRequirement(), newValue, 1e17),
|
|
656
657
|
"Tweak exceeded: liquidityRequirement tweaks only up to 10%"
|
|
657
658
|
);
|
|
658
|
-
_params.liquidityRequirement =
|
|
659
|
+
_params.liquidityRequirement = _wadTo4(newValue);
|
|
659
660
|
} else if (param == Parameter.minUtilizationRate) {
|
|
660
661
|
require(
|
|
661
662
|
!tweak || _isTweakWad(minUtilizationRate(), newValue, 3e17),
|
|
662
663
|
"Tweak exceeded: minUtilizationRate tweaks only up to 30%"
|
|
663
664
|
);
|
|
664
|
-
_params.minUtilizationRate =
|
|
665
|
+
_params.minUtilizationRate = _wadTo4(newValue);
|
|
665
666
|
} else if (param == Parameter.maxUtilizationRate) {
|
|
666
667
|
require(
|
|
667
668
|
!tweak || _isTweakWad(maxUtilizationRate(), newValue, 3e17),
|
|
668
669
|
"Tweak exceeded: maxUtilizationRate tweaks only up to 30%"
|
|
669
670
|
);
|
|
670
|
-
_params.maxUtilizationRate =
|
|
671
|
+
_params.maxUtilizationRate = _wadTo4(newValue);
|
|
671
672
|
} else if (param == Parameter.internalLoanInterestRate) {
|
|
672
673
|
require(
|
|
673
674
|
!tweak || _isTweakWad(internalLoanInterestRate(), newValue, 3e17),
|
|
@@ -677,9 +678,7 @@ contract EToken is Reserve, IERC20Metadata, IEToken {
|
|
|
677
678
|
// So, if interest rate goes from 5% to 6%, this change will be retroactive to the lastUpdate of each
|
|
678
679
|
// loan. Since it's a permissioned call, I'm ok with this. If a caller wants to reduce the impact, it can
|
|
679
680
|
// issue 1 wei repayLoan to each active loan, forcing the update of the scales
|
|
680
|
-
_params.internalLoanInterestRate =
|
|
681
|
-
} else {
|
|
682
|
-
revert("Invalid param!");
|
|
681
|
+
_params.internalLoanInterestRate = _wadTo4(newValue);
|
|
683
682
|
}
|
|
684
683
|
_parameterChanged(
|
|
685
684
|
IAccessManager.GovernanceActions(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {SafeCast} from "@openzeppelin/contracts/utils/math/SafeCast.sol";
|
|
5
5
|
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
6
6
|
import {IPolicyPoolComponent} from "./interfaces/IPolicyPoolComponent.sol";
|
|
7
7
|
import {IAssetManager} from "./interfaces/IAssetManager.sol";
|
|
@@ -19,7 +19,7 @@ import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
|
|
|
19
19
|
* @author Ensuro
|
|
20
20
|
*/
|
|
21
21
|
abstract contract LiquidityThresholdAssetManager is IAssetManager {
|
|
22
|
-
using
|
|
22
|
+
using SafeCast for uint256;
|
|
23
23
|
|
|
24
24
|
IERC20Metadata internal immutable _asset;
|
|
25
25
|
event GovernanceAction(IAccessManager.GovernanceActions indexed action, uint256 value);
|
|
@@ -70,7 +70,7 @@ abstract contract LiquidityThresholdAssetManager is IAssetManager {
|
|
|
70
70
|
uint256 investmentValue = getInvestmentValue();
|
|
71
71
|
DiamondStorage storage ds = diamondStorage();
|
|
72
72
|
int256 earnings = int256(investmentValue) - int256(uint256(ds.lastInvestmentValue));
|
|
73
|
-
ds.lastInvestmentValue =
|
|
73
|
+
ds.lastInvestmentValue = investmentValue.toUint128();
|
|
74
74
|
emit EarningsRecorded(earnings);
|
|
75
75
|
return earnings;
|
|
76
76
|
}
|
|
@@ -101,26 +101,27 @@ abstract contract LiquidityThresholdAssetManager is IAssetManager {
|
|
|
101
101
|
* do the payment
|
|
102
102
|
* @param paymentAmount The amount of the payment
|
|
103
103
|
*/
|
|
104
|
-
function refillWallet(uint256 paymentAmount) external override {
|
|
104
|
+
function refillWallet(uint256 paymentAmount) external override returns (uint256 deinvest) {
|
|
105
105
|
uint256 cash = _asset.balanceOf(address(this));
|
|
106
106
|
require(cash < paymentAmount, "No need to refill the wallet for this payment");
|
|
107
107
|
uint256 investmentValue = getInvestmentValue();
|
|
108
108
|
// try to leave the pool balance at liquidity_middle after the payment
|
|
109
|
-
|
|
109
|
+
deinvest = paymentAmount + liquidityMiddle() - cash;
|
|
110
110
|
if (deinvest > investmentValue) deinvest = investmentValue;
|
|
111
111
|
_deinvest(deinvest);
|
|
112
|
+
return deinvest;
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
function _invest(uint256 amount) internal virtual {
|
|
115
116
|
DiamondStorage storage ds = diamondStorage();
|
|
116
|
-
ds.lastInvestmentValue +=
|
|
117
|
+
ds.lastInvestmentValue += amount.toUint128();
|
|
117
118
|
emit MoneyInvested(amount);
|
|
118
119
|
// must be reimplemented do the actual cash movement
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
function _deinvest(uint256 amount) internal virtual {
|
|
122
123
|
DiamondStorage storage ds = diamondStorage();
|
|
123
|
-
ds.lastInvestmentValue -=
|
|
124
|
+
ds.lastInvestmentValue -= Math.min(uint256(ds.lastInvestmentValue), amount).toUint128();
|
|
124
125
|
emit MoneyDeinvested(amount);
|
|
125
126
|
// must be reimplemented do the actual cash movement
|
|
126
127
|
}
|
|
@@ -144,15 +145,15 @@ abstract contract LiquidityThresholdAssetManager is IAssetManager {
|
|
|
144
145
|
) external validateParamsAfterChange {
|
|
145
146
|
DiamondStorage storage ds = diamondStorage();
|
|
146
147
|
if (min != type(uint256).max) {
|
|
147
|
-
ds.liquidityMin =
|
|
148
|
+
ds.liquidityMin = (min / 10**_asset.decimals()).toUint32();
|
|
148
149
|
emit GovernanceAction(IAccessManager.GovernanceActions.setLiquidityMin, min);
|
|
149
150
|
}
|
|
150
151
|
if (middle != type(uint256).max) {
|
|
151
|
-
ds.liquidityMiddle =
|
|
152
|
+
ds.liquidityMiddle = (middle / 10**_asset.decimals()).toUint32();
|
|
152
153
|
emit GovernanceAction(IAccessManager.GovernanceActions.setLiquidityMiddle, middle);
|
|
153
154
|
}
|
|
154
155
|
if (max != type(uint256).max) {
|
|
155
|
-
ds.liquidityMax =
|
|
156
|
+
ds.liquidityMax = (max / 10**_asset.decimals()).toUint32();
|
|
156
157
|
emit GovernanceAction(IAccessManager.GovernanceActions.setLiquidityMax, max);
|
|
157
158
|
}
|
|
158
159
|
}
|
package/contracts/Policy.sol
CHANGED