Skip to content

Commit

Permalink
Update cannon (#2297)
Browse files Browse the repository at this point in the history
* Update cannon

* fix a couple local build issues that have been persistent

* try to fix wierd ci issue

* try building contracts before testable on ci because something wierd is
happening

* try wiping

---------

Co-authored-by: dbeal <[email protected]>
Co-authored-by: Daniel Beal <[email protected]>
  • Loading branch information
3 people authored Sep 23, 2024
1 parent 6e74595 commit 0e279e6
Show file tree
Hide file tree
Showing 20 changed files with 153 additions and 51 deletions.
2 changes: 1 addition & 1 deletion auxiliary/ERC4626ToAssetsRatioOracle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@synthetixio/docgen": "workspace:*",
"@synthetixio/main": "workspace:*",
"@synthetixio/wei": "^2.74.4",
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"ethers": "^5.7.2",
"hardhat": "^2.19.5",
"solidity-docgen": "^0.6.0-beta.36"
Expand Down
2 changes: 1 addition & 1 deletion auxiliary/RewardsDistributor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"forge-coverage": "forge coverage --report lcov"
},
"devDependencies": {
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"forge-std": "github:foundry-rs/forge-std#master"
},
"depcheck": {
Expand Down
2 changes: 1 addition & 1 deletion auxiliary/RewardsDistributorExternal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"forge-coverage": "forge coverage --report lcov"
},
"devDependencies": {
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"forge-std": "github:foundry-rs/forge-std#master"
},
"depcheck": {
Expand Down
2 changes: 1 addition & 1 deletion auxiliary/WstEthToStEthRatioOracle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@synthetixio/docgen": "workspace:*",
"@synthetixio/main": "workspace:*",
"@synthetixio/wei": "^2.74.4",
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"ethers": "^5.7.2",
"hardhat": "^2.19.5",
"solidity-docgen": "^0.6.0-beta.36"
Expand Down
2 changes: 1 addition & 1 deletion markets/bfp-market/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@synthetixio/wei": "^2.74.4",
"@types/lodash": "^4.14.199",
"@types/mocha-each": "^2.0.1",
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"ethers": "^5.7.2",
"hardhat": "^2.19.5",
"lodash": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion markets/perps-market/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@synthetixio/oracle-manager": "workspace:*",
"@synthetixio/spot-market": "workspace:*",
"@synthetixio/wei": "^2.74.4",
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"ethers": "^5.7.2",
"hardhat": "^2.19.5",
"solidity-docgen": "^0.6.0-beta.36",
Expand Down
2 changes: 1 addition & 1 deletion markets/perps-market/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"devDependencies": {
"@graphprotocol/graph-cli": "^0.81.0",
"@graphprotocol/graph-ts": "^0.35.1",
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"ethers": "^5.7.2",
"matchstick-as": "^0.6.0",
"prettier": "^3.2.5"
Expand Down
2 changes: 1 addition & 1 deletion markets/spot-market/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@synthetixio/oracle-manager": "workspace:*",
"@synthetixio/wei": "^2.74.4",
"@types/node-fetch": "^2.6.11",
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"ethers": "^5.7.2",
"hardhat": "^2.19.5",
"node-fetch": "^2.7.0",
Expand Down
2 changes: 1 addition & 1 deletion markets/spot-market/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"devDependencies": {
"@graphprotocol/graph-cli": "^0.81.0",
"@graphprotocol/graph-ts": "^0.35.1",
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"ethers": "^5.7.2",
"matchstick-as": "^0.6.0",
"prettier": "^3.2.5"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@types/node": "^20.11.17",
"@typescript-eslint/eslint-plugin": "^8.4.0",
"@typescript-eslint/parser": "^8.4.0",
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"eslint": "^9.9.1",
"eslint-plugin-no-only-tests": "^3.1.0",
"globals": "^15.9.0",
Expand Down
2 changes: 1 addition & 1 deletion protocol/governance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@synthetixio/core-modules": "workspace:*",
"@synthetixio/core-utils": "workspace:*",
"@synthetixio/docgen": "workspace:*",
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"ethers": "^5.7.2",
"hardhat": "^2.19.5",
"solidity-docgen": "^0.6.0-beta.36",
Expand Down
2 changes: 1 addition & 1 deletion protocol/oracle-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build": "yarn build:contracts",
"build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build",
"storage:dump": "hardhat storage:dump --output storage.new.dump.json",
"build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml",
"build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml --wipe",
"check:storage": "diff -uw storage.dump.json storage.new.dump.json",
"storage:verify": " hardhat storage:verify",
"generate-testable": "rm -rf contracts/generated && hardhat generate-testable",
Expand Down
4 changes: 2 additions & 2 deletions protocol/oracle-manager/test/integration/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ export function bootstrapWithNodes() {
[failingAggregator.address, 0, 6]
);

console.log('params fail', paramsFailing);

const registerNode = async (params: string) => {
const tx = await NodeModule.registerNode(NodeTypes.CHAINLINK, params, []);
await tx.wait();
// this may help with some ci flakes
await r.getProvider().send('evm_snapshot', []);
return await NodeModule.getNodeId(NodeTypes.CHAINLINK, params, []);
};

Expand Down
2 changes: 1 addition & 1 deletion protocol/synthetix/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"devDependencies": {
"@graphprotocol/graph-cli": "^0.81.0",
"@graphprotocol/graph-ts": "^0.35.1",
"@usecannon/cli": "2.17.1",
"@usecannon/cli": "2.17.2",
"ethers": "^5.7.2",
"matchstick-as": "^0.6.0",
"prettier": "^3.2.5"
Expand Down
2 changes: 1 addition & 1 deletion utils/common-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@typechain/hardhat": "^9.1.0",
"dotenv": "^16.4.3",
"hardhat": "^2.19.5",
"hardhat-cannon": "2.17.1",
"hardhat-cannon": "2.17.2",
"hardhat-contract-sizer": "^2.10.0",
"hardhat-gas-reporter": "^1.0.10",
"hardhat-ignore-warnings": "^0.2.9",
Expand Down
100 changes: 100 additions & 0 deletions utils/core-modules/cannonfile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name = "core-modules"
version = "<%= package.version %>"
description = "Test Deployment for Synthetix's Core Modules project"

# `salt` here only affects proxy contract
[setting.salt]
description = "Change this to a unique string when deploying multiple instances of the system. Note that only the proxy contract will be unique."
defaultValue = "core-modules"

[setting.owner]
description = "Admin user for the system"
defaultValue = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"

# Core Modules
[contract.OwnerModule]
artifact = "contracts/modules/OwnerModule.sol:OwnerModule"

[contract.UpgradeModule]
artifact = "contracts/modules/UpgradeModule.sol:UpgradeModule"

[contract.CoreModule]
artifact = "contracts/modules/CoreModule.sol:CoreModule"

[contract.AssociatedSystemsModule]
artifact = "contracts/modules/AssociatedSystemsModule.sol:AssociatedSystemsModule"

[contract.FeatureFlagModule]
artifact = "contracts/modules/FeatureFlagModule.sol:FeatureFlagModule"

[contract.TokenModule]
artifact = "contracts/modules/TokenModule.sol:TokenModule"

[contract.DecayTokenModule]
artifact = "contracts/modules/DecayTokenModule.sol:DecayTokenModule"

[contract.NftModule]
artifact = "contracts/modules/NftModule.sol:NftModule"

# Mocks
[contract.SampleFeatureFlagModule]
artifact = "contracts/modules/mocks/SampleFeatureFlagModule.sol:SampleFeatureFlagModule"

[contract.SampleOwnedModule]
artifact = "contracts/modules/mocks/SampleOwnedModule.sol:SampleOwnedModule"

[contract.GenericModule]
artifact = "contracts/modules/mocks/GenericModule.sol:GenericModule"

[contract.CcipRouterMock]
artifact = "contracts/mocks/CcipRouterMock.sol:CcipRouterMock"

# Setup Initial Proxy
[contract.Proxy]
artifact = "contracts/Proxy.sol:Proxy"
args = ["<%= contracts.CoreRouter.address %>", "<%= settings.owner %>"]
abiOf = ["CoreRouter"]
salt = "<%= settings.salt %>"

# Core Router
[router.CoreRouter]
contracts = ["CoreModule"]

# AssociatedSystemsModule Router
[router.AssociatedSystemsModuleRouter]
contracts = ["CoreModule", "AssociatedSystemsModule"]

# TokenModule Router
[router.TokenModuleRouter]
contracts = ["CoreModule", "TokenModule"]

[router.TokenModuleRouter2]
contracts = ["CoreModule", "TokenModule"]
salt = "second"

[router.TokenModuleRouter3]
contracts = ["CoreModule", "TokenModule"]
salt = "third"

# DecayTokenModule Router
[router.DecayTokenModuleRouter]
contracts = ["CoreModule", "DecayTokenModule"]

# Sample Router
[router.SampleRouter]
contracts = ["CoreModule", "SampleOwnedModule"]

# NftModule Router ( we need multiple for tests)
[router.NftModuleRouter]
contracts = ["CoreModule", "NftModule"]

[router.NftModuleRouter2]
contracts = ["CoreModule", "NftModule"]
salt = "second"

[router.NftModuleRouter3]
contracts = ["CoreModule", "NftModule"]
salt = "third"

[router.FeatureFlagModuleRouter]
contracts = ["CoreModule", "FeatureFlagModule", "SampleFeatureFlagModule"]
4 changes: 2 additions & 2 deletions utils/core-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@types/micromatch": "^4",
"@types/prompts": "^2.4.9",
"@usecannon/builder": "2.17.1",
"@usecannon/cli": "2.17.1",
"@usecannon/builder": "2.17.2",
"@usecannon/cli": "2.17.2",
"ethers": "^5.7.2",
"get-port": "^7.0.0",
"hardhat": "^2.19.5",
Expand Down
4 changes: 3 additions & 1 deletion utils/core-utils/src/utils/solidity/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ async function _getCompiler(version: string) {
const isDownloaded = await downloader.isCompilerDownloaded(version);

if (!isDownloaded) {
await downloader.downloadCompiler(
// NOTE: any is used here because on some people's computers, the `downloadCompiler` function comes out with different types (who knows why but its better to just not)
// eslint-disable-next-line
await (downloader as any).downloadCompiler(
version,
async () => {},
async () => {}
Expand Down
2 changes: 1 addition & 1 deletion utils/sample-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@synthetixio/hardhat-storage": "workspace:*",
"ethers": "^5.7.2",
"hardhat": "^2.19.5",
"hardhat-cannon": "2.17.1",
"hardhat-cannon": "2.17.2",
"solidity-coverage": "^0.8.7"
}
}
Loading

0 comments on commit 0e279e6

Please sign in to comment.