generated from Uniswap/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from dzimiks/tenderly-vnet-ci
Tenderly Virtual TestNet CI/CD
- Loading branch information
Showing
2 changed files
with
299 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Deploy to Tenderly Virtual TestNet | ||
on: [pull_request] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
# Create Tenderly Virtual TestNet environment: https://docs.tenderly.co/virtual-testnets | ||
- name: Setup Tenderly Virtual TestNet | ||
uses: Tenderly/[email protected] | ||
with: | ||
access_key: ${{ secrets.TENDERLY_ACCESS_KEY }} | ||
project_name: ${{ vars.TENDERLY_PROJECT_SLUG }} | ||
account_name: ${{ vars.TENDERLY_ACCOUNT_SLUG }} | ||
testnet_name: 'Uniswap VNet CI/CD ${{ github.run_id }}' | ||
mode: 'CD' | ||
# ETH Mainnet config: https://docs.tenderly.co/supported-networks | ||
network_id: 1 | ||
chain_id: 1 | ||
block_number: 'latest' | ||
# Enable explorer & verification: https://docs.tenderly.co/virtual-testnets/testnet-explorer | ||
public_explorer: true | ||
verification_visibility: 'src' | ||
state_sync: false | ||
|
||
# Fund wallet using unlimited faucet: https://docs.tenderly.co/virtual-testnets/unlimited-faucet | ||
- name: Fund Account | ||
env: | ||
TENDERLY_ADMIN_RPC_URL: ${{ env.TENDERLY_ADMIN_RPC_URL }} | ||
ADMIN_WALLET: ${{ vars.ADMIN_WALLET }} | ||
run: | | ||
curl $TENDERLY_ADMIN_RPC_URL \ | ||
-X POST \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ | ||
"jsonrpc": "2.0", | ||
"method": "tenderly_setBalance", | ||
"params": [ | ||
"${{ vars.ADMIN_WALLET }}", | ||
"0x3635c9adc5dea00000" | ||
], | ||
"id": "1234" | ||
}' | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Foundry Build | ||
run: | | ||
forge --version | ||
forge build --sizes | ||
# Deploy & verify contracts | ||
- name: Deploy Contracts | ||
env: | ||
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} | ||
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | ||
FOUNDRY_ETH_RPC_URL: ${{ env.TENDERLY_PUBLIC_RPC_URL }} | ||
FOUNDRY_VERIFIER_URL: ${{ env.TENDERLY_FOUNDRY_VERIFICATION_URL }} | ||
run: | | ||
forge script script/deploy/Deploy-all.s.sol \ | ||
--private-key $PRIVATE_KEY \ | ||
--rpc-url $FOUNDRY_ETH_RPC_URL \ | ||
--verifier-url $FOUNDRY_VERIFIER_URL \ | ||
--slow \ | ||
--broadcast \ | ||
--verify |
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,228 @@ | ||
{ | ||
"protocols": { | ||
"permit2": { | ||
"name": "Permit 2", | ||
"deploy": false, | ||
"contracts": { | ||
"permit2": { | ||
"deploy": false, | ||
"address": null, | ||
"params": { | ||
"salt": { | ||
"type": "bytes32", | ||
"value": "0x0000000000000000000000000000000000000000d3af2663da51c10215000000" | ||
} | ||
}, | ||
"lookup": { | ||
"latest": "Permit2" | ||
} | ||
} | ||
} | ||
}, | ||
"v2": { | ||
"name": "Uniswap v2", | ||
"deploy": true, | ||
"contracts": { | ||
"UniswapV2Factory": { | ||
"deploy": false, | ||
"address": "0x1f98400000000000000000000000000000000002", | ||
"params": { | ||
"feeToSetter": { | ||
"type": "address" | ||
} | ||
}, | ||
"lookup": { | ||
"latest": "UniswapV2Factory" | ||
} | ||
}, | ||
"UniswapV2Router02": { | ||
"deploy": true, | ||
"address": null, | ||
"params": { | ||
"factory": { | ||
"name": "Uniswap v2 factory address", | ||
"pointer": "protocols.v2.contracts.UniswapV2Factory" | ||
} | ||
}, | ||
"dependencies": [ | ||
"weth" | ||
] | ||
} | ||
} | ||
}, | ||
"v3": { | ||
"name": "Uniswap v3", | ||
"deploy": true, | ||
"contracts": { | ||
"UniswapV3Factory": { | ||
"deploy": false, | ||
"address": "0x1f98400000000000000000000000000000000003", | ||
"lookup": { | ||
"latest": "UniswapV3Factory" | ||
}, | ||
"params": { | ||
"initialOwner": { | ||
"type": "address" | ||
} | ||
} | ||
}, | ||
"UniswapInterfaceMulticall": { | ||
"deploy": true | ||
}, | ||
"QuoterV2": { | ||
"deploy": true, | ||
"address": null, | ||
"params": { | ||
"factory": { | ||
"name": "Uniswap v3 factory address", | ||
"pointer": "protocols.v3.contracts.UniswapV3Factory" | ||
} | ||
}, | ||
"dependencies": [ | ||
"weth" | ||
] | ||
}, | ||
"TickLens": { | ||
"deploy": true | ||
}, | ||
"NonfungibleTokenPositionDescriptor": { | ||
"deploy": true, | ||
"address": null, | ||
"params": { | ||
"nativeCurrencyLabel": { | ||
"type": "string", | ||
"value": "ETH" | ||
}, | ||
"proxyAdminOwner": { | ||
"type": "address", | ||
"value": "0xC2fD2FA964C091AFcF95A835Ec19f04593AbbE07" | ||
} | ||
}, | ||
"dependencies": [ | ||
"weth" | ||
] | ||
}, | ||
"NonfungiblePositionManager": { | ||
"deploy": true, | ||
"address": null, | ||
"params": { | ||
"factory": { | ||
"name": "Uniswap v3 factory address", | ||
"pointer": "protocols.v3.contracts.UniswapV3Factory" | ||
}, | ||
"tokenDescriptor": { | ||
"name": "NFT Position Descriptor address", | ||
"pointer": "protocols.v3.contracts.NonfungibleTokenPositionDescriptor" | ||
} | ||
}, | ||
"dependencies": [ | ||
"weth" | ||
] | ||
}, | ||
"V3Migrator": { | ||
"deploy": true, | ||
"params": { | ||
"factory": { | ||
"name": "Uniswap v3 factory address", | ||
"pointer": "protocols.v3.contracts.UniswapV3Factory" | ||
}, | ||
"nonfungiblePositionManager": { | ||
"name": "Uniswap v3 position manager address", | ||
"pointer": "protocols.v3.contracts.NonfungiblePositionManager" | ||
} | ||
}, | ||
"dependencies": [ | ||
"weth" | ||
] | ||
}, | ||
"SwapRouter": { | ||
"deploy": false, | ||
"address": null, | ||
"params": { | ||
"factory": { | ||
"name": "Uniswap v3 factory address", | ||
"pointer": "protocols.v3.contracts.UniswapV3Factory" | ||
} | ||
}, | ||
"dependencies": [ | ||
"weth" | ||
] | ||
} | ||
} | ||
}, | ||
"view-quoter-v3": { | ||
"name": "View Quoter v3", | ||
"deploy": true, | ||
"contracts": { | ||
"Quoter": { | ||
"deploy": true, | ||
"params": { | ||
"factory": { | ||
"name": "Uniswap v3 factory address", | ||
"pointer": "protocols.v3.contracts.UniswapV3Factory" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"swap-router-contracts": { | ||
"name": "Swap Router Contracts", | ||
"deploy": true, | ||
"contracts": { | ||
"SwapRouter02": { | ||
"deploy": true, | ||
"params": { | ||
"factoryV2": { | ||
"name": "Uniswap v2 factory address", | ||
"pointer": "protocols.v2.contracts.UniswapV2Factory" | ||
}, | ||
"factoryV3": { | ||
"name": "Uniswap v3 factory address", | ||
"pointer": "protocols.v3.contracts.UniswapV3Factory" | ||
}, | ||
"positionManager": { | ||
"name": "Uniswap v3 position manager address", | ||
"pointer": "protocols.v3.contracts.NonfungiblePositionManager" | ||
} | ||
}, | ||
"dependencies": [ | ||
"weth" | ||
] | ||
} | ||
} | ||
}, | ||
"util-contracts": { | ||
"name": "Utils", | ||
"deploy": true, | ||
"contracts": { | ||
"FeeOnTransferDetector": { | ||
"deploy": true, | ||
"address": null, | ||
"params": { | ||
"factoryV2": { | ||
"name": "Uniswap v2 factory address", | ||
"pointer": "protocols.v2.contracts.UniswapV2Factory" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"dependencies": { | ||
"weth": { | ||
"type": "address", | ||
"lookup": { | ||
"history": [ | ||
"UniversalRouter.input.constructor.params.weth9", | ||
"QuoterV2.input.constructor._WETH9", | ||
"V3Migrator.input.constructor._WETH9", | ||
"NonfungiblePositionManager.input.constructor._WETH9", | ||
"NonFungibleTokenPositionDescriptor.input.constructor._WETH9", | ||
"SwapRouter.input.constructor._WETH9", | ||
"Quoter.input.constructor._WETH9" | ||
] | ||
}, | ||
"value": "0x4200000000000000000000000000000000000006" | ||
} | ||
} | ||
} |