Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contracts for Linked Token and Axelar Tokens are Upgradable #792

Closed
wants to merge 14 commits into from

Conversation

snissn
Copy link
Contributor

@snissn snissn commented Mar 13, 2024

Make axelar-token and linked-token contracts upgradable

Using OpenZeppelin's framework

Upgradable means:

  1. move constructor to initialize
  2. inherit from Initializable if it is the actual contract being deployed and inherit from onlyInitializing if it is a base class
  3. all of the contracts that a contract inherits follows these rules
  4. if user deployed have a deploy script and an upgrade script
  • axelar-token:

    • IpcTokenHandler.sol
      • move constructor to initialize and inherit from Initializable
    • InterchainTokenExecutable.sol
      • build an upgradable form of this in the axelar-token folder
    • IpcTokenSender.sol
      • move constructor to initialize()
      • inherit from Initializable
    • sdk/IpcContract.sol
      • move constructor of IpcExchange to initialize()
      • inherit from onlyInitializing
      • update ownable and reentry guard imports and initialize them
    • Update Deploy script
    • Build upgrade script
  • LinkedToken:

    • LinkedTokenController make upgradable
    • LinkedToken.sol make upgradable
    • LinkedTokenReplica.sol make upgradable
    • LinkedTokenReplica.sol inherits from Upgradable ERC20
    • deploy scripts
    • upgrade scripts

Closes ENG-739

Copy link

linear bot commented Mar 16, 2024

@raulk raulk added the Fluence label Mar 18, 2024
Copy link
Contributor

@raulk raulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's separate this into two PRs please. One for Axelar, one for LinkedToken. It looks like Linked Token is ready, but Axelar Token isn't. Axelar Token isn't all that important because it has a recovery path and is stateless/disposable.

However, Linked Token is stateful, so we need to land this now, and the Axelar Token can wait.

@snissn
Copy link
Contributor Author

snissn commented Mar 19, 2024

It looks like Linked Token is ready

not quite! I am still working on the upgrade script succeeding. Then I will definitely open a PR for that code

@jsoares
Copy link
Contributor

jsoares commented Mar 22, 2024

Am I right in thinking that this PR will be rescoped to Axelar alone and the Linked Token is covered by #837? Please adjust title and description if so 🙏

@snissn
Copy link
Contributor Author

snissn commented Mar 22, 2024

Am I right in thinking that this PR will be rescoped to Axelar alone and the Linked Token is covered by #837? Please adjust title and description if so 🙏

@jsoares I'm going to close this PR and when we are ready to review Axelar I will open a new one

@snissn snissn closed this Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants