DistributedCollective / DistributedCollective/Sovryn-smart-contracts

Refactor protocol pauser

Open
#319 0 comments 0 reactions 1 assignee View on GitHub

@smbsp is already working on this.

Since Jul 14, 2021.

medium priority refactoring
Dominant language
JavaScript
Stars
132
Forks
57
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.