-
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
25 changed files
with
1,868 additions
and
29 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 |
---|---|---|
|
@@ -36,3 +36,4 @@ artifacts | |
report/ | ||
lcov.info | ||
|
||
src/evm/contracts |
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,6 @@ | ||
require("@nomicfoundation/hardhat-toolbox"); | ||
|
||
/** @type import('hardhat/config').HardhatUserConfig */ | ||
module.exports = { | ||
solidity: "0.8.24", | ||
}; |
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 |
---|---|---|
@@ -1,13 +1,83 @@ | ||
{ | ||
"name": "vibc-core-smart-contracts", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"repository": "https://github.com/open-ibc/vibc-core-smart-contracts", | ||
"name": "@open-ibc/vibc-core-smart-contracts", | ||
"version": "0.1.3", | ||
"main": "dist/index.js", | ||
"bin": { | ||
"deploy-vibc-core-smart-contracts": "./dist/scripts/deploy-script.js", | ||
"upgrade-vibc-core-smart-contracts": "./dist/scripts/upgrade-script.js" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"solhint": "^4.1.1" | ||
"@commander-js/extra-typings": "^12.0.1", | ||
"@typechain/ethers-v6": "^0.5.0", | ||
"ethers": "^6.4.0", | ||
"nunjucks": "^3.2.4", | ||
"solhint": "^4.1.1", | ||
"typechain": "^8.3.0", | ||
"winston": "^3.13.0", | ||
"yaml": "^2.4.1", | ||
"zod": "^3.23.4", | ||
"zx": "^8.0.2" | ||
}, | ||
"devDependencies": { | ||
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0", | ||
"@nomicfoundation/hardhat-ethers": "^3.0.0", | ||
"@nomicfoundation/hardhat-ignition": "^0.15.0", | ||
"@nomicfoundation/hardhat-ignition-ethers": "^0.15.0", | ||
"@nomicfoundation/hardhat-network-helpers": "^1.0.0", | ||
"@nomicfoundation/hardhat-toolbox": "^5.0.0", | ||
"@nomicfoundation/hardhat-verify": "^2.0.0", | ||
"@typechain/hardhat": "^9.0.0", | ||
"@types/nunjucks": "^3.2.6", | ||
"@types/winston": "^2.4.4", | ||
"chai": "^4.2.0", | ||
"hardhat": "^2.14.0", | ||
"hardhat-gas-reporter": "^1.0.8", | ||
"solidity-coverage": "^0.8.0", | ||
"tsup": "^8.0.2" | ||
}, | ||
"scripts": { | ||
"lint": "solhint contracts/**/*.sol" | ||
"lint": "solhint contracts/**/*.sol", | ||
"test": "forge test", | ||
"build": "npm run gen-types && tsup", | ||
"build-contracts": "forge build", | ||
"gen-types": "npm run build-contracts && typechain --target ethers-v6 --out-dir src/evm/contracts/ './out/?(OpProofVerifier|ProofVerifier|Ibc|Channel|Dispatcher|Mars|Earth|UniversalChannelHandler|DummyProofVerifier|DummyLightClient|ERC1967Proxy|OpLightClient).sol/*.json'", | ||
"deploy-contracts": "npm run build && node dist/deploy.js", | ||
"deploy-simple": "node dist/deploy.js", | ||
"prepublish": "npm run build" | ||
}, | ||
"keywords": [ | ||
"evm", | ||
"cosmos", | ||
"rollup", | ||
"op-stack", | ||
"interoperability", | ||
"solidity" | ||
], | ||
"author": "Polymer Labs", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"./evm": { | ||
"require": "./dist/evm/index.js", | ||
"import": "./dist/evm/index.js", | ||
"types": "./dist/evm/index.d.ts" | ||
}, | ||
"./evm/account": "./dist/evm/account.js", | ||
"./evm/chain": "./dist/evm/chain.js", | ||
"./evm/schemas/contract": "./dist/evm/schemas/contract.js", | ||
"./evm/schemas/tx": "./dist/evm/schemas/tx.js", | ||
"./utils": { | ||
"require": "./dist/utils/index.js", | ||
"import": "./dist/utils/index.js", | ||
"types": "./dist/utils/index.d.ts" | ||
}, | ||
"./utils/cli": "./dist/utils/cli.js", | ||
"./utils/io": "./dist/utils/io.js" | ||
} | ||
|
||
} |
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,77 @@ | ||
# spec for deploying contracts | ||
# {{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}} | ||
# NOTE: order of the contracts matters, as some contracts depend on others | ||
# contracts with no deps should be placed before those with deps | ||
# deployer: must be a valid name in accountRegistry; default to 'default' if not specified | ||
|
||
- 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}}' | ||
deployer: 'KEY_POLYMER' | ||
|
||
- name: DispatcherProxy | ||
description: 'Dispatcher proxy contract' | ||
factoryName: 'ERC1967Proxy' | ||
deployArgs: | ||
- '{{Dispatcher}}' | ||
- '$INITARGS' | ||
init: | ||
signature: 'initialize(string,address)' | ||
args: | ||
- 'polyibc.{{chain.chainName}}.' | ||
- '{{LightClient}}' | ||
deployer: 'KEY_POLYMER' | ||
|
||
- name: UC | ||
description: 'Universal Chanel IBC-middleware contract' | ||
factoryName: 'UniversalChannelHandler' | ||
deployer: 'KEY_POLYMER' | ||
libraries: | ||
- name: 'contracts/libs/Ibc.sol:IbcUtils' | ||
address: '{{IbcUtils}}' | ||
|
||
- name: UCProxy | ||
description: 'Universal Chanel IBC-middleware proxy' | ||
factoryName: 'ERC1967Proxy' | ||
deployArgs: | ||
- '{{UC}}' | ||
- '$INITARGS' | ||
init: | ||
signature: 'initialize(address)' | ||
args: | ||
- '{{DispatcherProxy}}' | ||
deployer: 'KEY_POLYMER' | ||
|
||
# dApp contracts for testing and as examples | ||
|
||
- name: Mars | ||
description: 'Mars contract directly owns a IBC channel' | ||
deployArgs: | ||
- '{{DispatcherProxy}}' | ||
deployer: 'KEY_POLYMER' | ||
|
||
- name: Earth | ||
description: 'Earth contract uses shared universal channel' | ||
deployArgs: | ||
- '{{UCProxy}}' | ||
deployer: 'KEY_POLYMER' |
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,3 @@ | ||
# These accounts are derived from a test mnemonic by Anvil/Hardhat and used for testing purposes only. | ||
- name: 'KEY_POLYMER' | ||
privateKey: '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' |
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,16 @@ | ||
# spec for deploying contracts | ||
# {{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}} | ||
# NOTE: order of the contracts matters, as some contracts depend on others | ||
# contracts with no deps should be placed before those with deps | ||
# deployer: must be a valid name in accountRegistry; default to 'default' if not specified | ||
|
||
# call on a given factoryname | ||
- name: DispatcherUpgradeII | ||
description: 'Upgrade for dispatcher contract' | ||
deployer: 'KEY_POLYMER' # can be set in the accounts.yaml | ||
signature: "upgradeTo(address)" | ||
factoryName: "Dispatcher" | ||
args: | ||
- '{{Dispatcher}}' |
Oops, something went wrong.