Sovryn-smart-contracts
Sovryn-smart-contracts copied to clipboard
Refactor protocol pauser
https://github.com/DistributedCollective/Sovryn-smart-contracts/pull/311 as discussed primarily with @smbsp e.g. in _setTarget(this.swapExternal.selector, target); this.swapExternal.selector is replaced for this.swapExternal.selector^this.xor.selector (which should be a constant - ) in all modules that will lead to calling non-existing functions from the protocol meaning that all the calls will be transferred to the fallback function so, add fallback functions to all modules which will serve as a hook prior to calling any module function
in the fallback function:
- check that the protocol is not on pause and virtually any preliminary processing
- xor func sig again to restore true func sig
- check that the true sig exists
- call the function with the tru func sig
verify
- possible gas limit with the fallback function
- check each function call gas overhead