@gooddollar/goodprotocol 1.0.12 → 1.0.13-beta.2
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/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.json +2 -2
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.json +2 -2
- package/contracts/utils/ProxyFactory1967.sol +1 -0
- package/package.json +1 -1
- package/test/governance/StakersDistribution.test.ts +13 -13
- package/test/staking/DonationsStaking.test.ts +18 -15
- package/test/utils/ProxyFactory.test.ts +31 -0
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"type": "receive"
|
|
76
76
|
}
|
|
77
77
|
],
|
|
78
|
-
"bytecode": "
|
|
79
|
-
"deployedBytecode": "
|
|
78
|
+
"bytecode": "0x608060405234801561001057600080fd5b50610586806100206000396000f3fe6080604052600436106100225760003560e01c8063d1f578941461003957610031565b366100315761002f61004c565b005b61002f61004c565b61002f6100473660046103c3565b61005e565b61005c61005761013d565b61014c565b565b6000610068610170565b6001600160a01b0316146100b15760405162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b60448201526064015b60405180910390fd5b6100dc60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610453565b60008051602061050a833981519152146100f8576100f8610478565b6101388383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250925061018c915050565b505050565b6000610147610170565b905090565b3660008037600080366000845af43d6000803e80801561016b573d6000f35b3d6000fd5b60008051602061050a833981519152546001600160a01b031690565b610195836101b7565b6000825111806101a25750805b15610138576101b183836101f7565b50505050565b6101c081610223565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061021c838360405180606001604052806027815260200161052a602791396102b6565b9392505050565b803b6102875760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016100a8565b60008051602061050a83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060833b6103155760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016100a8565b600080856001600160a01b03168560405161033091906104ba565b600060405180830381855af49150503d806000811461036b576040519150601f19603f3d011682016040523d82523d6000602084013e610370565b606091505b509150915061038082828661038a565b9695505050505050565b6060831561039957508161021c565b8251156103a95782518084602001fd5b8160405162461bcd60e51b81526004016100a891906104d6565b6000806000604084860312156103d857600080fd5b83356001600160a01b03811681146103ef57600080fd5b925060208401356001600160401b038082111561040b57600080fd5b818601915086601f83011261041f57600080fd5b81358181111561042e57600080fd5b87602082850101111561044057600080fd5b6020830194508093505050509250925092565b60008282101561047357634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b60005b838110156104a9578181015183820152602001610491565b838111156101b15750506000910152565b600082516104cc81846020870161048e565b9190910192915050565b60208152600082518060208401526104f581604085016020870161048e565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207042cfb19d1fdfc26a8082f087ef0d00316160f896cc3192dcbfda3956ae41c164736f6c63430008080033",
|
|
79
|
+
"deployedBytecode": "0x6080604052600436106100225760003560e01c8063d1f578941461003957610031565b366100315761002f61004c565b005b61002f61004c565b61002f6100473660046103c3565b61005e565b61005c61005761013d565b61014c565b565b6000610068610170565b6001600160a01b0316146100b15760405162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b60448201526064015b60405180910390fd5b6100dc60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610453565b60008051602061050a833981519152146100f8576100f8610478565b6101388383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250925061018c915050565b505050565b6000610147610170565b905090565b3660008037600080366000845af43d6000803e80801561016b573d6000f35b3d6000fd5b60008051602061050a833981519152546001600160a01b031690565b610195836101b7565b6000825111806101a25750805b15610138576101b183836101f7565b50505050565b6101c081610223565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061021c838360405180606001604052806027815260200161052a602791396102b6565b9392505050565b803b6102875760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016100a8565b60008051602061050a83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060833b6103155760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016100a8565b600080856001600160a01b03168560405161033091906104ba565b600060405180830381855af49150503d806000811461036b576040519150601f19603f3d011682016040523d82523d6000602084013e610370565b606091505b509150915061038082828661038a565b9695505050505050565b6060831561039957508161021c565b8251156103a95782518084602001fd5b8160405162461bcd60e51b81526004016100a891906104d6565b6000806000604084860312156103d857600080fd5b83356001600160a01b03811681146103ef57600080fd5b925060208401356001600160401b038082111561040b57600080fd5b818601915086601f83011261041f57600080fd5b81358181111561042e57600080fd5b87602082850101111561044057600080fd5b6020830194508093505050509250925092565b60008282101561047357634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b60005b838110156104a9578181015183820152602001610491565b838111156101b15750506000910152565b600082516104cc81846020870161048e565b9190910192915050565b60208152600082518060208401526104f581604085016020870161048e565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207042cfb19d1fdfc26a8082f087ef0d00316160f896cc3192dcbfda3956ae41c164736f6c63430008080033",
|
|
80
80
|
"linkReferences": {},
|
|
81
81
|
"deployedLinkReferences": {}
|
|
82
82
|
}
|
|
@@ -165,8 +165,8 @@
|
|
|
165
165
|
"type": "function"
|
|
166
166
|
}
|
|
167
167
|
],
|
|
168
|
-
"bytecode": "
|
|
169
|
-
"deployedBytecode": "
|
|
168
|
+
"bytecode": "0x608060405234801561001057600080fd5b5060405161002060208201610044565b601f1982820381018352601f90910116604052805160209190910120600055610051565b6105a680610d6f83390190565b610d0f806100606000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80630bf61a011461005c5780631b903b841461008557806340ad200d1461009857806381ae1f5b146100ab578063b3eeb5e2146100be575b600080fd5b61006f61006a366004610512565b6100d1565b60405161007c9190610568565b60405180910390f35b61006f61009336600461057c565b6100e7565b61006f6100a63660046105f7565b61016c565b61006f6100b936600461062c565b6101df565b61006f6100cc366004610658565b6101f5565b60006100df848484336102f2565b949350505050565b60008061012b853386868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103cd92505050565b90507fcf78cf0d6f3d8371e1075c69c492ab4ec5d8cf23a1a239b6a51a1d00be7ca3128160405161015c9190610568565b60405180910390a1949350505050565b60008061017985856103fe565b6040516001600160f81b031960208201526001600160601b03193060601b166021820152603581018290526055810185905290915060009060750160408051808303601f1901815291905280516020909101206001600160a01b03169695505050505050565b60006101ee838360005461016c565b9392505050565b6000808360601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09250507efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e7349826040516102709190610568565b60405180910390a18251156102eb576000826001600160a01b03168460405161029991906106d5565b6000604051808303816000865af19150503d80600081146102d6576040519150601f19603f3d011682016040523d82523d6000602084013e6102db565b606091505b50509050806102e957600080fd5b505b5092915050565b6000806040518060200161030590610447565b601f1982820381018352601f90910116604052905060006103278785846103cd565b60405163347d5e2560e21b815290915081906001600160a01b0382169063d1f578949061035a908a908a906004016106f1565b600060405180830381600087803b15801561037457600080fd5b505af1158015610388573d6000803e3d6000fd5b505050507efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e7349816040516103ba9190610568565b60405180910390a1979650505050505050565b60008060006103dc86866103fe565b9050808451602086016000f59150813b6103f557600080fd5b50949350505050565b6000828260405160200161042992919091825260601b6001600160601b031916602082015260340190565b60405160208183030381529060405280519060200120905092915050565b6105a68061073483390190565b80356001600160a01b038116811461046b57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261049757600080fd5b81356001600160401b03808211156104b1576104b1610470565b604051601f8301601f19908116603f011681019082821181831017156104d9576104d9610470565b816040528381528660208588010111156104f257600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561052757600080fd5b8335925061053760208501610454565b915060408401356001600160401b0381111561055257600080fd5b61055e86828701610486565b9150509250925092565b6001600160a01b0391909116815260200190565b60008060006040848603121561059157600080fd5b8335925060208401356001600160401b03808211156105af57600080fd5b818601915086601f8301126105c357600080fd5b8135818111156105d257600080fd5b8760208285010111156105e457600080fd5b6020830194508093505050509250925092565b60008060006060848603121561060c57600080fd5b8335925061061c60208501610454565b9150604084013590509250925092565b6000806040838503121561063f57600080fd5b8235915061064f60208401610454565b90509250929050565b6000806040838503121561066b57600080fd5b61067483610454565b915060208301356001600160401b0381111561068f57600080fd5b61069b85828601610486565b9150509250929050565b60005b838110156106c05781810151838201526020016106a8565b838111156106cf576000848401525b50505050565b600082516106e78184602087016106a5565b9190910192915050565b60018060a01b0383168152604060208201526000825180604084015261071e8160608501602087016106a5565b601f01601f191691909101606001939250505056fe608060405234801561001057600080fd5b50610586806100206000396000f3fe6080604052600436106100225760003560e01c8063d1f578941461003957610031565b366100315761002f61004c565b005b61002f61004c565b61002f6100473660046103c3565b61005e565b61005c61005761013d565b61014c565b565b6000610068610170565b6001600160a01b0316146100b15760405162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b60448201526064015b60405180910390fd5b6100dc60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610453565b60008051602061050a833981519152146100f8576100f8610478565b6101388383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250925061018c915050565b505050565b6000610147610170565b905090565b3660008037600080366000845af43d6000803e80801561016b573d6000f35b3d6000fd5b60008051602061050a833981519152546001600160a01b031690565b610195836101b7565b6000825111806101a25750805b15610138576101b183836101f7565b50505050565b6101c081610223565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061021c838360405180606001604052806027815260200161052a602791396102b6565b9392505050565b803b6102875760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016100a8565b60008051602061050a83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060833b6103155760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016100a8565b600080856001600160a01b03168560405161033091906104ba565b600060405180830381855af49150503d806000811461036b576040519150601f19603f3d011682016040523d82523d6000602084013e610370565b606091505b509150915061038082828661038a565b9695505050505050565b6060831561039957508161021c565b8251156103a95782518084602001fd5b8160405162461bcd60e51b81526004016100a891906104d6565b6000806000604084860312156103d857600080fd5b83356001600160a01b03811681146103ef57600080fd5b925060208401356001600160401b038082111561040b57600080fd5b818601915086601f83011261041f57600080fd5b81358181111561042e57600080fd5b87602082850101111561044057600080fd5b6020830194508093505050509250925092565b60008282101561047357634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b60005b838110156104a9578181015183820152602001610491565b838111156101b15750506000910152565b600082516104cc81846020870161048e565b9190910192915050565b60208152600082518060208401526104f581604085016020870161048e565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207042cfb19d1fdfc26a8082f087ef0d00316160f896cc3192dcbfda3956ae41c164736f6c63430008080033a26469706673582212205205993217a9553028a33a3cfd4d212ecac3a1a6b6c69a13bd98e425fcf68bc664736f6c63430008080033608060405234801561001057600080fd5b50610586806100206000396000f3fe6080604052600436106100225760003560e01c8063d1f578941461003957610031565b366100315761002f61004c565b005b61002f61004c565b61002f6100473660046103c3565b61005e565b61005c61005761013d565b61014c565b565b6000610068610170565b6001600160a01b0316146100b15760405162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b60448201526064015b60405180910390fd5b6100dc60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610453565b60008051602061050a833981519152146100f8576100f8610478565b6101388383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250925061018c915050565b505050565b6000610147610170565b905090565b3660008037600080366000845af43d6000803e80801561016b573d6000f35b3d6000fd5b60008051602061050a833981519152546001600160a01b031690565b610195836101b7565b6000825111806101a25750805b15610138576101b183836101f7565b50505050565b6101c081610223565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061021c838360405180606001604052806027815260200161052a602791396102b6565b9392505050565b803b6102875760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016100a8565b60008051602061050a83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060833b6103155760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016100a8565b600080856001600160a01b03168560405161033091906104ba565b600060405180830381855af49150503d806000811461036b576040519150601f19603f3d011682016040523d82523d6000602084013e610370565b606091505b509150915061038082828661038a565b9695505050505050565b6060831561039957508161021c565b8251156103a95782518084602001fd5b8160405162461bcd60e51b81526004016100a891906104d6565b6000806000604084860312156103d857600080fd5b83356001600160a01b03811681146103ef57600080fd5b925060208401356001600160401b038082111561040b57600080fd5b818601915086601f83011261041f57600080fd5b81358181111561042e57600080fd5b87602082850101111561044057600080fd5b6020830194508093505050509250925092565b60008282101561047357634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b60005b838110156104a9578181015183820152602001610491565b838111156101b15750506000910152565b600082516104cc81846020870161048e565b9190910192915050565b60208152600082518060208401526104f581604085016020870161048e565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207042cfb19d1fdfc26a8082f087ef0d00316160f896cc3192dcbfda3956ae41c164736f6c63430008080033",
|
|
169
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c80630bf61a011461005c5780631b903b841461008557806340ad200d1461009857806381ae1f5b146100ab578063b3eeb5e2146100be575b600080fd5b61006f61006a366004610512565b6100d1565b60405161007c9190610568565b60405180910390f35b61006f61009336600461057c565b6100e7565b61006f6100a63660046105f7565b61016c565b61006f6100b936600461062c565b6101df565b61006f6100cc366004610658565b6101f5565b60006100df848484336102f2565b949350505050565b60008061012b853386868080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506103cd92505050565b90507fcf78cf0d6f3d8371e1075c69c492ab4ec5d8cf23a1a239b6a51a1d00be7ca3128160405161015c9190610568565b60405180910390a1949350505050565b60008061017985856103fe565b6040516001600160f81b031960208201526001600160601b03193060601b166021820152603581018290526055810185905290915060009060750160408051808303601f1901815291905280516020909101206001600160a01b03169695505050505050565b60006101ee838360005461016c565b9392505050565b6000808360601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f09250507efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e7349826040516102709190610568565b60405180910390a18251156102eb576000826001600160a01b03168460405161029991906106d5565b6000604051808303816000865af19150503d80600081146102d6576040519150601f19603f3d011682016040523d82523d6000602084013e6102db565b606091505b50509050806102e957600080fd5b505b5092915050565b6000806040518060200161030590610447565b601f1982820381018352601f90910116604052905060006103278785846103cd565b60405163347d5e2560e21b815290915081906001600160a01b0382169063d1f578949061035a908a908a906004016106f1565b600060405180830381600087803b15801561037457600080fd5b505af1158015610388573d6000803e3d6000fd5b505050507efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e7349816040516103ba9190610568565b60405180910390a1979650505050505050565b60008060006103dc86866103fe565b9050808451602086016000f59150813b6103f557600080fd5b50949350505050565b6000828260405160200161042992919091825260601b6001600160601b031916602082015260340190565b60405160208183030381529060405280519060200120905092915050565b6105a68061073483390190565b80356001600160a01b038116811461046b57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261049757600080fd5b81356001600160401b03808211156104b1576104b1610470565b604051601f8301601f19908116603f011681019082821181831017156104d9576104d9610470565b816040528381528660208588010111156104f257600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561052757600080fd5b8335925061053760208501610454565b915060408401356001600160401b0381111561055257600080fd5b61055e86828701610486565b9150509250925092565b6001600160a01b0391909116815260200190565b60008060006040848603121561059157600080fd5b8335925060208401356001600160401b03808211156105af57600080fd5b818601915086601f8301126105c357600080fd5b8135818111156105d257600080fd5b8760208285010111156105e457600080fd5b6020830194508093505050509250925092565b60008060006060848603121561060c57600080fd5b8335925061061c60208501610454565b9150604084013590509250925092565b6000806040838503121561063f57600080fd5b8235915061064f60208401610454565b90509250929050565b6000806040838503121561066b57600080fd5b61067483610454565b915060208301356001600160401b0381111561068f57600080fd5b61069b85828601610486565b9150509250929050565b60005b838110156106c05781810151838201526020016106a8565b838111156106cf576000848401525b50505050565b600082516106e78184602087016106a5565b9190910192915050565b60018060a01b0383168152604060208201526000825180604084015261071e8160608501602087016106a5565b601f01601f191691909101606001939250505056fe608060405234801561001057600080fd5b50610586806100206000396000f3fe6080604052600436106100225760003560e01c8063d1f578941461003957610031565b366100315761002f61004c565b005b61002f61004c565b61002f6100473660046103c3565b61005e565b61005c61005761013d565b61014c565b565b6000610068610170565b6001600160a01b0316146100b15760405162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b60448201526064015b60405180910390fd5b6100dc60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610453565b60008051602061050a833981519152146100f8576100f8610478565b6101388383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250925061018c915050565b505050565b6000610147610170565b905090565b3660008037600080366000845af43d6000803e80801561016b573d6000f35b3d6000fd5b60008051602061050a833981519152546001600160a01b031690565b610195836101b7565b6000825111806101a25750805b15610138576101b183836101f7565b50505050565b6101c081610223565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b606061021c838360405180606001604052806027815260200161052a602791396102b6565b9392505050565b803b6102875760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016100a8565b60008051602061050a83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060833b6103155760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016100a8565b600080856001600160a01b03168560405161033091906104ba565b600060405180830381855af49150503d806000811461036b576040519150601f19603f3d011682016040523d82523d6000602084013e610370565b606091505b509150915061038082828661038a565b9695505050505050565b6060831561039957508161021c565b8251156103a95782518084602001fd5b8160405162461bcd60e51b81526004016100a891906104d6565b6000806000604084860312156103d857600080fd5b83356001600160a01b03811681146103ef57600080fd5b925060208401356001600160401b038082111561040b57600080fd5b818601915086601f83011261041f57600080fd5b81358181111561042e57600080fd5b87602082850101111561044057600080fd5b6020830194508093505050509250925092565b60008282101561047357634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b60005b838110156104a9578181015183820152602001610491565b838111156101b15750506000910152565b600082516104cc81846020870161048e565b9190910192915050565b60208152600082518060208401526104f581604085016020870161048e565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212207042cfb19d1fdfc26a8082f087ef0d00316160f896cc3192dcbfda3956ae41c164736f6c63430008080033a26469706673582212205205993217a9553028a33a3cfd4d212ecac3a1a6b6c69a13bd98e425fcf68bc664736f6c63430008080033",
|
|
170
170
|
"linkReferences": {},
|
|
171
171
|
"deployedLinkReferences": {}
|
|
172
172
|
}
|
|
@@ -12,6 +12,7 @@ contract ERC1967Proxy is Proxy, ERC1967Upgrade {
|
|
|
12
12
|
* function call, and allows initializating the storage of the proxy like a Solidity constructor.
|
|
13
13
|
*/
|
|
14
14
|
function initialize(address _logic, bytes calldata _data) external payable {
|
|
15
|
+
require(_getImplementation() == address(0), "initialized");
|
|
15
16
|
assert(
|
|
16
17
|
_IMPLEMENTATION_SLOT ==
|
|
17
18
|
bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)
|
package/package.json
CHANGED
|
@@ -213,7 +213,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
213
213
|
await setDAOAddress("GDAO_STAKERS", stakersDistribution.address);
|
|
214
214
|
});
|
|
215
215
|
|
|
216
|
-
|
|
216
|
+
it("it should have 2M monthly Reputation distribution", async () => {
|
|
217
217
|
const monthlyReputationDistribution =
|
|
218
218
|
await stakersDistribution.monthlyReputationDistribution();
|
|
219
219
|
expect(monthlyReputationDistribution).to.be.equal(
|
|
@@ -221,14 +221,14 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
221
221
|
);
|
|
222
222
|
});
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
it("it should have 0 monthly rewards since staking amount was zero while initializing stakersDistribution", async () => {
|
|
225
225
|
const rewardsPerBlock = await stakersDistribution.rewardsPerBlock(
|
|
226
226
|
simpleStaking.address
|
|
227
227
|
);
|
|
228
228
|
expect(rewardsPerBlock).to.be.equal(0);
|
|
229
229
|
});
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
it("It should update monthly rewards according to staking amount of staking contract after one month passed from initialized", async () => {
|
|
232
232
|
const stakingAmount = ethers.utils.parseEther("1000");
|
|
233
233
|
const rewardsPerBlockBeforeStake =
|
|
234
234
|
await stakersDistribution.rewardsPerBlock(simpleStaking.address);
|
|
@@ -257,7 +257,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
257
257
|
expect(rewardsPerBlockAfterStake).to.be.equal(rewardsPerBlockAfterWithdraw);
|
|
258
258
|
});
|
|
259
259
|
|
|
260
|
-
|
|
260
|
+
it("it should not be set monthly reputation when not Avatar", async () => {
|
|
261
261
|
const transaction = await stakersDistribution
|
|
262
262
|
.setMonthlyReputationDistribution("1000000")
|
|
263
263
|
.catch(e => e);
|
|
@@ -266,7 +266,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
266
266
|
);
|
|
267
267
|
});
|
|
268
268
|
|
|
269
|
-
|
|
269
|
+
it("it should set monthly reputation when Avatar", async () => {
|
|
270
270
|
let encoded = stakersDistribution.interface.encodeFunctionData(
|
|
271
271
|
"setMonthlyReputationDistribution",
|
|
272
272
|
[ethers.utils.parseEther("1000000")]
|
|
@@ -284,7 +284,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
284
284
|
await genericCall(stakersDistribution.address, encoded);
|
|
285
285
|
});
|
|
286
286
|
|
|
287
|
-
|
|
287
|
+
it("it should distribute monthly rewards according to staking amount of contracts so in this particular case simpleStaking contract should get %75 of the monthly rewards ", async () => {
|
|
288
288
|
const goodFundManagerFactory = await ethers.getContractFactory(
|
|
289
289
|
"GoodFundManager"
|
|
290
290
|
);
|
|
@@ -349,7 +349,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
349
349
|
await ictrl.genericCall(goodFundManager.address, encodedData, avatar, 0);
|
|
350
350
|
});
|
|
351
351
|
|
|
352
|
-
|
|
352
|
+
it("It should not update monthly rewards if staking contract's blockEnd Passed", async () => {
|
|
353
353
|
const goodFundManagerFactory = await ethers.getContractFactory(
|
|
354
354
|
"GoodFundManager"
|
|
355
355
|
);
|
|
@@ -403,7 +403,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
403
403
|
.true;
|
|
404
404
|
});
|
|
405
405
|
|
|
406
|
-
|
|
406
|
+
it("it should give distribute if blockend passed but some of the rewards during reward period was not distributed", async () => {
|
|
407
407
|
const goodFundManagerFactory = await ethers.getContractFactory(
|
|
408
408
|
"GoodFundManager"
|
|
409
409
|
);
|
|
@@ -449,7 +449,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
449
449
|
);
|
|
450
450
|
});
|
|
451
451
|
|
|
452
|
-
|
|
452
|
+
it("it should not increaseProductivity of staking contract which is blacklisted", async () => {
|
|
453
453
|
const goodFundManagerFactory = await ethers.getContractFactory(
|
|
454
454
|
"GoodFundManager"
|
|
455
455
|
);
|
|
@@ -484,7 +484,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
484
484
|
expect(productivityOfStaker[0]).to.be.equal(0);
|
|
485
485
|
});
|
|
486
486
|
|
|
487
|
-
|
|
487
|
+
it("it should not decreaseProductivity of staking contract which is blacklisted", async () => {
|
|
488
488
|
const goodFundManagerFactory = await ethers.getContractFactory(
|
|
489
489
|
"GoodFundManager"
|
|
490
490
|
);
|
|
@@ -555,7 +555,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
555
555
|
expect(pendingGDAO).equal(0); //should have 0 pending after contract was blacklisted
|
|
556
556
|
});
|
|
557
557
|
|
|
558
|
-
|
|
558
|
+
it("it should not earn rewards when current block < startBlock", async () => {
|
|
559
559
|
const goodFundManagerFactory = await ethers.getContractFactory(
|
|
560
560
|
"GoodFundManager"
|
|
561
561
|
);
|
|
@@ -619,7 +619,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
619
619
|
await ictrl.genericCall(goodFundManager.address, encodedData, avatar, 0);
|
|
620
620
|
});
|
|
621
621
|
|
|
622
|
-
|
|
622
|
+
it("Accumulated per share has enough precision when reward << totalproductivity", async () => {
|
|
623
623
|
const goodFundManagerFactory = await ethers.getContractFactory(
|
|
624
624
|
"GoodFundManager"
|
|
625
625
|
);
|
|
@@ -676,7 +676,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
|
|
|
676
676
|
await ictrl.genericCall(goodFundManager.address, encodedData, avatar, 0);
|
|
677
677
|
});
|
|
678
678
|
|
|
679
|
-
|
|
679
|
+
it("it should distribute rewards properly when staking contract's token is different decimals than 18", async () => {
|
|
680
680
|
const goodFundManagerFactory = await ethers.getContractFactory(
|
|
681
681
|
"GoodFundManager"
|
|
682
682
|
);
|
|
@@ -218,6 +218,7 @@ describe("DonationsStaking - DonationStaking contract that receives funds in ETH
|
|
|
218
218
|
expect(totalStakedBeforeStake).to.be.equal(0);
|
|
219
219
|
expect(totalStakedAfterStake).to.be.gt(totalStakedBeforeStake);
|
|
220
220
|
});
|
|
221
|
+
|
|
221
222
|
it("it should stake donations with DAI", async () => {
|
|
222
223
|
let stakeAmount = ethers.utils.parseEther("10");
|
|
223
224
|
await dai["mint(address,uint256)"](donationsStaking.address, stakeAmount);
|
|
@@ -228,6 +229,13 @@ describe("DonationsStaking - DonationStaking contract that receives funds in ETH
|
|
|
228
229
|
stakeAmount
|
|
229
230
|
);
|
|
230
231
|
});
|
|
232
|
+
|
|
233
|
+
it("it should reverted when there is no token to stake", async () => {
|
|
234
|
+
await expect(donationsStaking.stakeDonations()).to.be.revertedWith(
|
|
235
|
+
"no stakingToken to stake"
|
|
236
|
+
);
|
|
237
|
+
});
|
|
238
|
+
|
|
231
239
|
it("it should stake donations with ETH according to 0.3% of pool", async () => {
|
|
232
240
|
let stakeAmount = ethers.utils.parseEther("20");
|
|
233
241
|
const pairContract = await ethers.getContractAt(
|
|
@@ -263,6 +271,7 @@ describe("DonationsStaking - DonationStaking contract that receives funds in ETH
|
|
|
263
271
|
expect(stakeAmount).to.be.gt(maxAmount);
|
|
264
272
|
expect(stakeAmount.sub(maxAmount)).to.be.equal(ethBalanceAfterStake); // check leftover ETH in contract
|
|
265
273
|
});
|
|
274
|
+
|
|
266
275
|
it("withdraw should reverted if caller not avatar", async () => {
|
|
267
276
|
const tx = await donationsStaking
|
|
268
277
|
.connect(staker)
|
|
@@ -270,6 +279,7 @@ describe("DonationsStaking - DonationStaking contract that receives funds in ETH
|
|
|
270
279
|
.catch(e => e);
|
|
271
280
|
expect(tx.message).to.have.string("only avatar can call this method");
|
|
272
281
|
});
|
|
282
|
+
|
|
273
283
|
it("it should withdraw donationStaking when caller is avatar and return funds to avatar", async () => {
|
|
274
284
|
const totalStakedBeforeEnd = await donationsStaking.totalStaked();
|
|
275
285
|
const avatarDaiBalanceBeforeEnd = await dai.balanceOf(avatar);
|
|
@@ -305,16 +315,9 @@ describe("DonationsStaking - DonationStaking contract that receives funds in ETH
|
|
|
305
315
|
|
|
306
316
|
expect(totalStakedAfterEnd).to.be.equal(0);
|
|
307
317
|
});
|
|
318
|
+
|
|
308
319
|
it("it should set stakingContract when avatar call it ", async () => {
|
|
309
320
|
let stakeAmount = ethers.utils.parseEther("6000"); // Max swap amount is around 5964 with current liquidity level so we should set it to higher number in order to test functionality
|
|
310
|
-
const donationsStakingFactory = await ethers.getContractFactory(
|
|
311
|
-
"DonationsStaking",
|
|
312
|
-
{
|
|
313
|
-
libraries: {
|
|
314
|
-
UniswapV2SwapHelper: swapHelper.address
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
);
|
|
318
321
|
|
|
319
322
|
await dai["mint(address,uint256)"](donationsStaking.address, stakeAmount);
|
|
320
323
|
await donationsStaking.stakeDonations();
|
|
@@ -342,7 +345,7 @@ describe("DonationsStaking - DonationStaking contract that receives funds in ETH
|
|
|
342
345
|
.then(async contract => {
|
|
343
346
|
await contract.init(
|
|
344
347
|
bat.address,
|
|
345
|
-
|
|
348
|
+
cBat.address,
|
|
346
349
|
nameService.address,
|
|
347
350
|
"Good BAT",
|
|
348
351
|
"gBAT",
|
|
@@ -353,12 +356,7 @@ describe("DonationsStaking - DonationStaking contract that receives funds in ETH
|
|
|
353
356
|
);
|
|
354
357
|
return contract;
|
|
355
358
|
});
|
|
356
|
-
|
|
357
|
-
// "setStakingContract",
|
|
358
|
-
// [simpleStaking.address, [NULL_ADDRESS, bat.address]]
|
|
359
|
-
//);
|
|
360
|
-
//
|
|
361
|
-
//await genericCall(donationsStaking.address, encodedData);
|
|
359
|
+
|
|
362
360
|
await donationsStaking.setStakingContract(simpleStaking.address, [
|
|
363
361
|
NULL_ADDRESS,
|
|
364
362
|
bat.address
|
|
@@ -390,4 +388,9 @@ describe("DonationsStaking - DonationStaking contract that receives funds in ETH
|
|
|
390
388
|
); // It should send leftover stakingToken to avatar after swap to ETH in safeAmount
|
|
391
389
|
expect(stakingAmountBeforeSet).to.be.gt(safeAmount); // maxSafeAmount must be smaller than actualstaking amount so we can verify that we hit the limit for transaction amount at once
|
|
392
390
|
});
|
|
391
|
+
|
|
392
|
+
it("it should return version of DonationsStaking properly", async () => {
|
|
393
|
+
const version = await donationsStaking.getVersion();
|
|
394
|
+
expect(version).to.be.equal("2.0.0");
|
|
395
|
+
});
|
|
393
396
|
});
|
|
@@ -99,4 +99,35 @@ describe("proxyfactory", () => {
|
|
|
99
99
|
proxy = await ethers.getContractAt("UpgradableMock", proxyAddr);
|
|
100
100
|
expect(await proxy.owner()).to.eq(signers[2].address);
|
|
101
101
|
});
|
|
102
|
+
|
|
103
|
+
it("should not be able to re-initialize proxy", async () => {
|
|
104
|
+
const c1 = await (
|
|
105
|
+
await ethers.getContractFactory("UpgradableMock")
|
|
106
|
+
).deploy();
|
|
107
|
+
const encoded = c1.interface.encodeFunctionData("initialize", [
|
|
108
|
+
signers[2].address
|
|
109
|
+
]);
|
|
110
|
+
|
|
111
|
+
const deployTX = await (
|
|
112
|
+
await factory.deployProxy(4, c1.address, encoded)
|
|
113
|
+
).wait();
|
|
114
|
+
const proxyAddr = deployTX.events.find(_ => _.event === "ProxyCreated").args
|
|
115
|
+
.proxy;
|
|
116
|
+
let proxy = await ethers.getContractAt("ERC1967Proxy", proxyAddr);
|
|
117
|
+
|
|
118
|
+
const c2 = await (
|
|
119
|
+
await ethers.getContractFactory("UpgradableMock")
|
|
120
|
+
).deploy();
|
|
121
|
+
|
|
122
|
+
const encoded2 = c1.interface.encodeFunctionData("initialize", [
|
|
123
|
+
signers[3].address
|
|
124
|
+
]);
|
|
125
|
+
|
|
126
|
+
await expect(
|
|
127
|
+
proxy["initialize(address,bytes)"](c2.address, encoded)
|
|
128
|
+
).revertedWith("initialized");
|
|
129
|
+
|
|
130
|
+
let orgproxy = await ethers.getContractAt("UpgradableMock", proxyAddr);
|
|
131
|
+
expect(await orgproxy.owner()).to.eq(signers[2].address);
|
|
132
|
+
});
|
|
102
133
|
});
|