Skip to content

Commit

Permalink
feat: deploy zrc 20 script (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito authored Sep 10, 2024
1 parent b68feb9 commit 4fed7cb
Show file tree
Hide file tree
Showing 45 changed files with 474 additions and 43 deletions.
12 changes: 12 additions & 0 deletions v2/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ ERC20_CUSTODY_ADMIN_ADDRESS_EVM=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
ZETA_CONNECTOR_ADMIN_ADDRESS_EVM=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
GATEWAY_PROXY_EVM=0x9f21B726FCb84D8e92cdC678772590dce5347D0B
ZETA_ERC20_EVM=0x42928581Ba60cD97B65D873151dc063F3D0619f8

# zevm
GATEWAY_PROXY_ZEVM=
SYSTEM_CONTRACT=

# update for every zrc20 deployment
ZRC20_NAME=
ZRC20_SYMBOL=
ZRC20_DECIMALS=
ZRC20_CHAIN_ID=
ZRC20_COIN_TYPE=
ZRC20_GAS_LIMIT=
1 change: 0 additions & 1 deletion v2/contracts/zevm/ZRC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ contract ZRC20 is IZRC20Metadata, ZRC20Errors, ZRC20Events {
address systemContractAddress_,
address gatewayAddress_
) {
if (msg.sender != FUNGIBLE_MODULE_ADDRESS) revert CallerIsNotFungibleModule();
if (systemContractAddress_ == address(0) || gatewayAddress_ == address(0)) revert ZeroAddress();
_name = name_;
_symbol = symbol_;
Expand Down
2 changes: 1 addition & 1 deletion v2/docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

We are currently developing Version 2 (V2) of our smart contract architecture. This new version will significantly enhance the developer experience for building Universal Apps.

Developers can already begin testing the new interface by referring to [the V2 Localnet guide](./scripts/localnet//v2_localnet.md).
Developers can already begin testing the new interface by referring to [the V2 Localnet guide](https://github.com/zeta-chain/localnet?tab=readme-ov-file#experimenting-with-the-new-architecture).

### Build

Expand Down
2 changes: 1 addition & 1 deletion v2/docs/src/contracts/Revert.sol/interface.Revertable.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Revertable
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/Revert.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/Revert.sol)

Interface for contracts that support revertable calls.

Expand Down
2 changes: 1 addition & 1 deletion v2/docs/src/contracts/Revert.sol/struct.RevertContext.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RevertContext
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/Revert.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/Revert.sol)

Struct containing revert context passed to onRevert.

Expand Down
2 changes: 1 addition & 1 deletion v2/docs/src/contracts/Revert.sol/struct.RevertOptions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RevertOptions
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/Revert.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/Revert.sol)

Struct containing revert options

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ERC20Custody
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/ERC20Custody.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/ERC20Custody.sol)

**Inherits:**
[IERC20Custody](/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20Custody.md), ReentrancyGuard, AccessControl, Pausable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GatewayEVM
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/GatewayEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/GatewayEVM.sol)

**Inherits:**
Initializable, AccessControlUpgradeable, UUPSUpgradeable, [IGatewayEVM](/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVM.md), ReentrancyGuardUpgradeable, PausableUpgradeable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZetaConnectorBase
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/ZetaConnectorBase.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/ZetaConnectorBase.sol)

**Inherits:**
[IZetaConnectorEvents](/contracts/evm/interfaces/IZetaConnector.sol/interface.IZetaConnectorEvents.md), ReentrancyGuard, Pausable, AccessControl
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZetaConnectorNative
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/ZetaConnectorNative.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/ZetaConnectorNative.sol)

**Inherits:**
[ZetaConnectorBase](/contracts/evm/ZetaConnectorBase.sol/abstract.ZetaConnectorBase.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZetaConnectorNonNative
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/ZetaConnectorNonNative.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/ZetaConnectorNonNative.sol)

**Inherits:**
[ZetaConnectorBase](/contracts/evm/ZetaConnectorBase.sol/abstract.ZetaConnectorBase.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IERC20Custody
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/interfaces/IERC20Custody.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/interfaces/IERC20Custody.sol)

**Inherits:**
[IERC20CustodyEvents](/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20CustodyEvents.md), [IERC20CustodyErrors](/contracts/evm/interfaces/IERC20Custody.sol/interface.IERC20CustodyErrors.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IERC20CustodyErrors
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/interfaces/IERC20Custody.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/interfaces/IERC20Custody.sol)

Interface for the errors used in the ERC20 custody contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IERC20CustodyEvents
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/interfaces/IERC20Custody.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/interfaces/IERC20Custody.sol)

Interface for the events emitted by the ERC20 custody contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayEVM
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/interfaces/IGatewayEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/interfaces/IGatewayEVM.sol)

**Inherits:**
[IGatewayEVMErrors](/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVMErrors.md), [IGatewayEVMEvents](/contracts/evm/interfaces/IGatewayEVM.sol/interface.IGatewayEVMEvents.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayEVMErrors
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/interfaces/IGatewayEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/interfaces/IGatewayEVM.sol)

Interface for the errors used in the GatewayEVM contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayEVMEvents
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/interfaces/IGatewayEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/interfaces/IGatewayEVM.sol)

Interface for the events emitted by the GatewayEVM contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IZetaConnectorEvents
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/interfaces/IZetaConnector.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/interfaces/IZetaConnector.sol)

Interface for the events emitted by the ZetaConnector contracts.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IZetaNonEthNew
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/evm/interfaces/IZetaNonEthNew.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/evm/interfaces/IZetaNonEthNew.sol)

**Inherits:**
IERC20
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GatewayZEVM
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/GatewayZEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/GatewayZEVM.sol)

**Inherits:**
[IGatewayZEVM](/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVM.md), Initializable, AccessControlUpgradeable, UUPSUpgradeable, ReentrancyGuardUpgradeable, PausableUpgradeable
Expand Down
2 changes: 1 addition & 1 deletion v2/docs/src/contracts/zevm/ZRC20.sol/contract.ZRC20.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZRC20
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/ZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/ZRC20.sol)

**Inherits:**
[IZRC20Metadata](/contracts/zevm/interfaces/IZRC20.sol/interface.IZRC20Metadata.md), [ZRC20Errors](/contracts/zevm/ZRC20.sol/interface.ZRC20Errors.md), [ZRC20Events](/contracts/zevm/interfaces/IZRC20.sol/interface.ZRC20Events.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZRC20Errors
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/ZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/ZRC20.sol)

*Custom errors for ZRC20*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayZEVM
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/IGatewayZEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/IGatewayZEVM.sol)

**Inherits:**
[IGatewayZEVMErrors](/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVMErrors.md), [IGatewayZEVMEvents](/contracts/zevm/interfaces/IGatewayZEVM.sol/interface.IGatewayZEVMEvents.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayZEVMErrors
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/IGatewayZEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/IGatewayZEVM.sol)

Interface for the errors used in the GatewayZEVM contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IGatewayZEVMEvents
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/IGatewayZEVM.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/IGatewayZEVM.sol)

Interface for the events emitted by the GatewayZEVM contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ISystem
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/ISystem.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/ISystem.sol)

Interface for the System contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IWETH9
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/IWZETA.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/IWZETA.sol)

Interface for the Weth9 contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CoinType
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/IZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/IZRC20.sol)

*Coin types for ZRC20. Zeta value should not be used.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IZRC20
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/IZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/IZRC20.sol)

Interface for the ZRC20 token contract.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IZRC20Metadata
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/IZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/IZRC20.sol)

**Inherits:**
[IZRC20](/contracts/zevm/interfaces/IZRC20.sol/interface.IZRC20.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ZRC20Events
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/IZRC20.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/IZRC20.sol)

Interface for the ZRC20 events.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# UniversalContract
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/UniversalContract.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/UniversalContract.sol)


## Functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# zContract
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/UniversalContract.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/UniversalContract.sol)


## Functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# zContext
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/c157025a39efca61d83e5991d093a94548f342fb/contracts/zevm/interfaces/UniversalContract.sol)
[Git Source](https://github.com/zeta-chain/protocol-contracts/blob/e9e111d59a014252dbe61290a7e2992479a0a46d/contracts/zevm/interfaces/UniversalContract.sol)


```solidity
Expand Down
2 changes: 1 addition & 1 deletion v2/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: "Protocol contracts"

We are currently developing Version 2 (V2) of our smart contract architecture. This new version will significantly enhance the developer experience for building Universal Apps.

Developers can already begin testing the new interface by referring to [the V2 Localnet guide](./scripts/localnet//v2_localnet.md).
Developers can already begin testing the new interface by referring to [the V2 Localnet guide](https://github.com/zeta-chain/localnet?tab=readme-ov-file#experimenting-with-the-new-architecture).

### Build

Expand Down
Loading

0 comments on commit 4fed7cb

Please sign in to comment.