Git Product home page Git Product logo

Comments (6)

hellwolf avatar hellwolf commented on June 18, 2024

@d10r please post the "secession fork testing" related work here.

After that, the owner of token that wish to secede should create an issue in this repo to request such governance action.

Technical challenges:

  • "flag changes"
  • "nullifcation" process
  • etc.

from protocol-monorepo.

d10r avatar d10r commented on June 18, 2024

fork test: https://github.com/superfluid-finance/custom-supertokens/blob/bridged-supertoken/test/foundry/BridgedSuperToken.t.sol#L80

Technical challenge with a seceding token:
There's no explicit role assigned to the upgrade privilege, the way it is in e.g. Ownable. Instead, the role is implicitly defined by the implementation contract through the logic of updateCode.
In case of the canonical SuperToken contract, the restriction is that only the host can trigger the update. The host contract can trigger this through updateSuperTokenLogic which can be called by gov only.
So through this indirections, SF gov has exclusive permission to update SuperTokens, but that's not something which can trivially be queried. The best way to check this may be to verify if the logic a SuperToken points to is the canonical one (as defined by SuperTokenFactory.getSuperTokenLogic()) - caveat being that one would have to keep track of all previous versions of canonical logics, or rely on the assumption that all tokens are always updated to the latest one.
In order to facilitate that, we could add a mapping(address => bool) canonicalSuperTokenLogicContracts which returns true for all contracts which ever were (or currently are) the canonical SuperToken implementation.
Alternatively we could rely on off-chain reconstruction, e.g. based on the event SuperTokenFactory.SuperTokenLogicCreated.

An alternative approach for distinguishing SuperTokens using the canonical logic could be to use UUPSProxiable.proxiableUUID - assuming only the canonical deployments return keccak256("org.superfluid-finance.contracts.SuperToken.implementation").
This assumption is however already invalidated by existing non-canonical deployments, e.g. by G$.

from protocol-monorepo.

hellwolf avatar hellwolf commented on June 18, 2024

In case of the canonical SuperToken contract, the restriction is that only the host can trigger the update. The host contract can trigger this through updateSuperTokenLogic which can be called by gov only.

Indeed.

But at the same time, ISuperfluid immutable internal _host; does not imply it has to be our host. A custom super token logic may simply set it to a different when during its construction. Would this work?

from protocol-monorepo.

d10r avatar d10r commented on June 18, 2024

Yeah, but that would create all kinds of additional implications, imo coming down to requiring a redundant deployment of the protocol. Much simpler to decouple the update privilege from the host in that custom logic.

from protocol-monorepo.

hellwolf avatar hellwolf commented on June 18, 2024

We can do a SuperToken revision around this rule.

from protocol-monorepo.

d10r avatar d10r commented on June 18, 2024

Added a deployment script.
Waiting for the FRACTION deployer to deploy (important contract params are hardcoded in the logic, so we can't deploy a generic version as is) and request an update.

We can exclude such SuperTokens with custom logic by modifying the upgrade script to compare SuperToken logic addresses against a list of all canonical implementations there existed, can be done by querying the protocol subgraph for

  superTokenLogicCreatedEvents {
    tokenLogic
  }

from protocol-monorepo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.