-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
588 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
# Spec for deploying contracts and configuring them via txs within a single run | ||
|
||
# NOTE: | ||
# {{name}} is replaced with one of the following, whichever matches first | ||
# - the deployed contract address whose name matches `name` (not factoryName) | ||
# - variables of the running chain, e.g. {{chain.chainName}}, {{chain.chainId}} | ||
# - deployment factory names from written deployment files | ||
# NOTE: order of the contracts matters, as some contracts depend on others | ||
# contracts with no deps should be placed before those with deps | ||
|
||
# Spec items can either be a ContractItemSchema, or TxItemSchema type: | ||
|
||
###### ContractItemSchema TYPE ###### | ||
# This spec can be used for deploying a contract, either from vibc-core or external contracts. | ||
|
||
## The following arguments can be specified in ContractItemSchema spec: | ||
# name: name of key that will be stored in the contract registry | ||
# deployer: must be # name of key that will be stored in the contract registry a valid name in accountRegistry; default to 'default' if not specified | ||
# description: description to be stored in the contract registry | ||
# factoryName: the name of the typechain factory used to deploy the contract | ||
# deployer: deployer key, should correspond to either a private key or one that can be looked up in the evm.accounts.yaml | ||
# libraries: if a contract depends on libraries, the location of the library file & the deployed library address can be specified here, as an array with 2 elements | ||
# deployArgs: The arguments that will be called in the contract constructor. Note: if $INITARGS is passed in as an argument, it will be abi.encode the arguments passed to the init paramater | ||
# init: any arguments that need to be abi encoded (e.g. for calling upgradeToAndCall for ERC1967Proxy). These will be rendered in the place of $INITARGS | ||
|
||
###### TxItemSchema TYPE ###### | ||
# This spec can be used for sending any tx to a contract, including proxy upgrades, calling setters, transferring ownership, etc. | ||
|
||
## The following arguments can be specified in tx spec: | ||
# name: name of entry that will be stored in tx registry | ||
# description: description in tx registry | ||
# factoryName: factory to use to read abi to send tx | ||
# deployer: can be set in the accounts.yaml | ||
# address: address of contract to call method on | ||
# signature: signature of method to call for this tx | ||
# args: args to make the function call with, need to be compatible with the signature | ||
|
||
- name: LightClient | ||
description: 'DummyLightClient' | ||
factoryName: 'DummyLightClient' | ||
deployer: 'KEY_POLYMER' | ||
|
||
- name: Ibc | ||
description: 'IBC library' | ||
factoryName: 'Ibc' | ||
deployer: 'KEY_POLYMER' | ||
|
||
- name: IbcUtils | ||
description: 'IBC utils library' | ||
factoryName: 'IbcUtils' | ||
deployer: 'KEY_POLYMER' | ||
|
||
- name: Dispatcher | ||
description: 'IBC Core contract' | ||
factoryName: 'Dispatcher' | ||
libraries: | ||
- name: 'contracts/libs/Ibc.sol:Ibc' | ||
address: '{{Ibc}}' | ||
- name: 'contracts/libs/IbcUtils.sol:IbcUtils' | ||
address: '{{IbcUtils}}' | ||
deployer: 'KEY_POLYMER' | ||
|
||
- name: FeeVault | ||
description: 'FeeVault' | ||
factoryName: 'FeeVault' | ||
deployer: 'KEY_POLYMER' | ||
|
||
- name: DispatcherProxy | ||
description: 'Dispatcher proxy contract' | ||
factoryName: 'ERC1967Proxy' | ||
deployArgs: | ||
- '{{Dispatcher}}' | ||
- '$INITARGS' | ||
init: | ||
signature: 'initialize(string,address)' | ||
args: | ||
- 'polyibc.{{chain.chainName}}.' | ||
- '{{FeeVault}}' | ||
deployer: 'KEY_POLYMER' | ||
|
||
- name: UC | ||
description: 'Universal Chanel IBC-middleware contract' | ||
factoryName: 'UniversalChannelHandler' | ||
deployer: 'KEY_POLYMER' | ||
libraries: | ||
- name: 'contracts/libs/IbcUtils.sol:IbcUtils' | ||
address: '{{IbcUtils}}' | ||
|
||
- name: UCProxy | ||
description: 'Universal Chanel IBC-middleware proxy' | ||
factoryName: 'ERC1967Proxy' | ||
deployer: 'KEY_POLYMER' | ||
deployArgs: | ||
- '{{UC}}' | ||
- '$INITARGS' | ||
init: | ||
signature: 'initialize(address)' | ||
args: | ||
- '{{DispatcherProxy}}' | ||
|
||
# dApp contracts for testing and as examples | ||
- name: Mars | ||
description: 'Mars contract directly owns a IBC channel' | ||
deployArgs: | ||
- '{{DispatcherProxy}}' | ||
deployer: 'KEY_DAPP1' | ||
|
||
- name: Earth | ||
description: 'Earth contract uses shared universal channel' | ||
deployArgs: | ||
- '{{UCProxy}}' | ||
deployer: 'KEY_DAPP2' | ||
|
||
|
||
# Contract Setup below | ||
- name: DispatcherUpgrade | ||
description: 'UUPS Upgrade for dispatcher contract implementation' | ||
deployer: 'KEY_POLYMER' | ||
signature: "upgradeTo(address)" | ||
address: '{{DispatcherProxy}}' | ||
factoryName: "Dispatcher" | ||
args: | ||
- '{{Dispatcher}}' | ||
|
||
- name: DispatcherUpgrade | ||
description: 'UUPS Upgrade for dispatcher contract implementation' | ||
deployer: 'KEY_POLYMER' | ||
signature: "upgradeTo(address)" | ||
address: '{{DispatcherProxy}}' | ||
factoryName: "Dispatcher" | ||
args: | ||
- '{{Dispatcher}}' | ||
|
||
- name: UCH Upgrade | ||
description: 'Upgrade for uch contract' | ||
deployer: 'KEY_POLYMER' | ||
signature: "upgradeTo(address)" | ||
address: '{{ UC Proxy }}' | ||
factoryName: "UC" | ||
args: | ||
- '{{UC}}' | ||
|
||
- name: DispatcherClientSetup-Connection-0 | ||
description: 'Setup client for dispatcher contracts' | ||
deployer: 'KEY_POLYMER' | ||
signature: "setClientForConnection(string,address)" | ||
address: '{{DispatcherProxy}}' | ||
factoryName: "Dispatcher" | ||
args: | ||
- 'connection-0' | ||
- '{{LightClient}}' | ||
|
||
- name: DispatcherClientSetup-Connection-1 | ||
description: 'Setup client for dispatcher contracts' | ||
deployer: 'KEY_POLYMER' | ||
signature: "setClientForConnection(string,address)" | ||
address: '{{DispatcherProxy}}' | ||
factoryName: "Dispatcher" | ||
args: | ||
- 'connection-2' | ||
- '{{LightClient}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.