πŸ€–
Smart Contract

Upgradeable Swap Protocol

What is an upgradeable contract?

One of the powerful features of the blockchain is its immutability. On the contrary, the quality of software came from upgrading and patching the code via iterative releases. The upgradeable proxy is a mechanism for upgrading smart contracts that can be controlled by a governance mechanism be it a multi-sig wallet, DAO, or even a simple address.

Why upgradeable?

As stated above, to deliver high-quality software we would love the ability to release the features iteratively. Said features are often new DEX integration, which in return will provide a better rate swap.
So why don't we just deploy a new contract without the proxy? Because that would require our users to approve the ERC-20 every time we change the smart contract. And we believe that won't give the best trading experience which is our aim.
The upgradeable contracts have downsides though. One of them is that a malicious actor can switch the implementation contract into something with unexpected behaviors e.g. stealing users' funds.

How to handle the malicious action?

The address that can execute the upgrade command on the proxy is the Timelock contract. This means everyone can see the upgrade 24 hours ahead of time before the actual change takes place. The users will have a decent amount of time to act accordingly in case a questionable upgrade is about to happen.

Deployed contracts

The explanation of each contract is as follows:
  • TransparentUpgradeableProxy is a proxy contract that points to the implementation (ArkenDex) contract. The admin of the proxy is ProxyAdmin.
  • ArkenDex is the swap protocol implementation. -- Note that you should never interact directly with this contract since it is not initialized with the correct configuration.
  • ProxyAdmin is the admin of the TransparentUpgradeableProxy contract. The owner of this contract is Timelock.
  • Timelock is the timelock mechanism contract. Any administration actions will be done through this contract.

Ethereum

TransparentUpgradeableProxy: 0x89d56979795c4b82828d893ac3ffe9711114a6f9
ArkenDex: 0xd288a09f07c5afbd65aea7ba9534d5f830f9d1c6
ProxyAdmin: 0x9ede19ede2baf93d25fba4c8f58577e008b8f963
Timelock: 0xFb5c4D167802099adb085a049B8fA39df769B07d
EtherWrapper: Coming soon

BSC

TransparentUpgradeableProxy: 0x1DA2CFDccd1AC5F1093a8c146260C5DC7159ed47
ArkenDex: 0xA50caa60772c56A0c193D75708E3Cd09b1DcB218
ProxyAdmin: 0x2136e339c2815Bec09AB897D88eFD28B2f9DA53d
Timelock: 0xD0f83087A8d0Cbe2f9148841b912899c26D0C0b9
EtherWrapper: 0xc2CbD2f01cAbDBeA25132ffF55cC001cC1944cb0

Polygon

TransparentUpgradeableProxy: 0x11a768b4Acf0212E9B0800d1B8142763518A4fC5
ArkenDex: 0x3A6c590a1f7cbd9851606A5e2D6F97059289216f
ProxyAdmin: 0x56AC7D363cA6ADFd65849B6330E6E27b11D5577A
Timelock: 0xB3bBb464485F159B839E1699A352cE6D542c9433
EtherWrapper: 0xaDeE472407F127E575F5B80349C2380064659b9E

Avalanche

TransparentUpgradeableProxy: 0x8f8667137Be38ca1973C908ae1A1D27CF0caCCe4
ArkenDex: 0xd288A09f07C5AfBd65AEa7ba9534D5f830f9d1c6
ProxyAdmin: 0x0db91c7dc41e6cb9c94e11d76478cf249e02afe3
Timelock: 0x6EDd44dD70Dca9947d7D72F664Af3579c92De279
EtherWrapper: 0x91aC657bDFF58f526E9B288c410321C7845d20a2

Changelog

15 November 2021
  • Deploy on Avalanche Network
​
2 November 2021
​
28 October 2021
Last modified 2mo ago