Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
2dc4d90
solana: add new IDs
a5-pickle Jul 19, 2024
cee22bb
solana: fix stack access err
a5-pickle Jul 26, 2024
09ad27b
initial commit deployment scripts
solanoepalacio May 10, 2024
3122ddc
environment setup utils
solanoepalacio May 10, 2024
0f7d16a
adds gitignore to deployment directory
solanoepalacio May 10, 2024
791acfb
improves configuration structure
solanoepalacio May 10, 2024
d192dc1
evm deploy matching engine script
solanoepalacio May 10, 2024
371eb32
config placeholders for testnet chains
solanoepalacio May 16, 2024
c33754a
evm: deploy-token-router script
solanoepalacio May 16, 2024
ece0606
WIP deployment scripts
AgusVelez5 Jun 13, 2024
17132ef
Validate values on tokenRouter proxy deployment
AgusVelez5 Jun 13, 2024
e3349ea
Add config scripts
AgusVelez5 Jun 24, 2024
7e58f45
Refactor scripts deps
AgusVelez5 Jul 1, 2024
1a533ce
Add ecosystem json
AgusVelez5 Jul 2, 2024
0083a6b
Update readme
AgusVelez5 Jul 2, 2024
1caa884
Remove unused var
AgusVelez5 Jul 2, 2024
8725e68
Refactor verification scripts
AgusVelez5 Jul 10, 2024
dbb637b
Deprecate matching engine evm scripts
AgusVelez5 Jul 15, 2024
6ce7ad6
Refactor base fn and add disable script
AgusVelez5 Jul 17, 2024
6c913fe
deploy: minor fix in README
scnale Jul 12, 2024
b8dde61
misc: adds `tmp` to .gitignore
scnale Jul 12, 2024
29fa171
deploy: adds solana as a local package dependency
scnale Jul 17, 2024
6d0fcba
deploy: adds spl token package
scnale Jul 18, 2024
f18d73c
deploy: adds solana matching engine initialize script
scnale Jul 18, 2024
5994efb
WIP scripts
AgusVelez5 Jul 19, 2024
48a442d
deploy: adds register router script for solana matching engine
scnale Jul 19, 2024
84ef0f8
Finished cross registration script
AgusVelez5 Jul 22, 2024
77f08a4
deploy: build only proxy contract from openzeppelin
scnale Jul 22, 2024
d18f354
deploy: adds Solana config
scnale Jul 22, 2024
b779b46
deploy: mainnet configuration
scnale Jul 22, 2024
cf092cb
deploy: removes matching engine code for EVM
scnale Jul 22, 2024
7051e80
deploy: adds tsconfig.json and simplifies contract build pipeline
scnale Jul 22, 2024
1455ff8
deploy: cleans up helper exports to avoid name collisions
scnale Jul 22, 2024
23dc77e
deploy: renames helper function
scnale Jul 22, 2024
0a370c7
Fix ts errors
AgusVelez5 Jul 23, 2024
e43bf13
Finish bytecode verification script
AgusVelez5 Jul 24, 2024
7f95719
deploy: adds addresses to mainnet config
scnale Jul 24, 2024
8245873
deploy: retrieves mint recipient from solana sdk
scnale Jul 24, 2024
08bc576
deploy: several adjustments to `initialize` script
scnale Jul 25, 2024
063c6ca
Add solana programs helpers
AgusVelez5 Jul 25, 2024
038fb14
deploy: adds priority fee to `initialize` instruction
scnale Jul 25, 2024
43d92e9
deploy: adds token router initialize script
scnale Jul 25, 2024
9cd7c1a
misc: adds ts-build to gitignore
scnale Jul 25, 2024
3b25e04
solana: adds mainnet support in a few program getter functions
scnale Jul 25, 2024
e761480
deploy: a few fixes for the initialize matching engine script
scnale Jul 26, 2024
7497b03
Assert local deps with connect deps
AgusVelez5 Jul 29, 2024
8c9bad1
deploy: adds mainnet solana token router config
scnale Jul 30, 2024
898dde9
deploy: cleans up imports
scnale Jul 30, 2024
833cb0e
deploy: fixes token router config query
scnale Jul 30, 2024
e3ea806
deploy: use commonjs reference for solana bindings in tsconfig
scnale Jul 30, 2024
8a7982f
deploy: adds "Mainnet" marker to config
scnale Jul 30, 2024
9f18aab
deploy: prints error stack if available
scnale Jul 30, 2024
56c9d47
deploy: adds type alias for constructor arguments
scnale Jul 30, 2024
1785320
deploy: creates type for token router state
scnale Jul 30, 2024
c1111b8
deploy: fixes token router registration script in Solana
scnale Jul 30, 2024
2aaa627
deploy: adds mainnet deployment output
scnale Jul 30, 2024
b7b0a59
Token router config hotfix
AgusVelez5 Aug 22, 2024
11abed5
fix cross-registration deployment script - use mintRecipientAddress n…
nonergodic Aug 23, 2024
510d7d8
updates mainnet matching engine mint recipient address
solanoepalacio Aug 22, 2024
bb6efcc
deployment: ignor build-info files
solanoepalacio Aug 22, 2024
29fc5ad
deployment: cross-registration - get mint recipient always from solana
solanoepalacio Aug 23, 2024
3c23ee7
deployment: cross-registration - update router endpoint if it already…
solanoepalacio Aug 23, 2024
2d0216c
Revert "deployment: cross-registration - get mint recipient always fr…
solanoepalacio Aug 23, 2024
c6c766f
deployment: cross-registration - get mint reecipient based on the target
solanoepalacio Aug 23, 2024
850a596
deployment: updates mainnet addresses
solanoepalacio Aug 23, 2024
7cda366
mainnet upgrade
solanoepalacio Aug 26, 2024
9f44a3b
take matchingEngine data froms deps
AgusVelez5 Oct 8, 2024
f1e8653
add config for new evm chains
AgusVelez5 Oct 8, 2024
8c54e02
Merge tag 'v0.3.1' into deployment-scripts
AgusVelez5 Oct 18, 2024
6f40011
add solana upgradeMainnet script
AgusVelez5 Oct 18, 2024
9160e40
deployment: pins `@solana/web3.js` to match the rest of the workspaces
scnale Oct 18, 2024
6d7c26c
adds solana upgrade scripts
solanoepalacio Oct 18, 2024
d80fbfd
solana upgrade token router script
solanoepalacio Oct 18, 2024
c65512e
Deployed to new chains: 2, 5, 6, 24
solanoepalacio Oct 18, 2024
4505cb6
minor fixes to solana deployment/upgrade scripts
solanoepalacio Oct 18, 2024
c445190
Merge tag 'v0.3.3' into deployment-scripts
AgusVelez5 Nov 5, 2024
bf66561
updateAuctionParameters script + small fixes.
hernandp Jan 8, 2025
7b13d16
deployment: fixes solana upgrade scripts
scnale Jan 8, 2025
774808b
deployment: adds solana commit upgrade script
scnale Jan 8, 2025
354e58a
deployment: cleans up solana script
scnale Jan 8, 2025
5af3f4d
deployment: removes wrong check from update auction parameters
scnale Jan 8, 2025
ca961b1
matchingEngine Auction parameters mgmt scripts (#206)
hernandp Jan 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ node_modules
*.tgz
dist
.env
out
cache
tmp
ts-build
2 changes: 2 additions & 0 deletions deployment/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
contract-bindings
**.env
39 changes: 39 additions & 0 deletions deployment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contracts scrips

### Before start

- Install & Build

```
npm ci
npm run build-evm
```

- Add the desired networks where you want to work on the [ecosystem file](./config/testnet/ecosystem.json) with the format:

```
type ChainInfo = {
name: string;
chainId: number; // EVM ChainId
rpc: string;
type: "Mainnet" | "Testnet" | "Devnet";
externalId?: string;
}
```

- Configure the dependencies on the [dependencies file](./config/testnet/dependencies.json).

- Add the config for each chain in the [MatchingEngine](./config/testnet/matching-engine.json) config file or the [TokenRouter](./config/testnet/token-router.json) config file.


### EVM scripts

```
npx tsx ./scripts/evm/<ContractName>/<ScriptName>.ts
```

### Solana scripts

```
npx tsx ./scripts/solana/<ContractName>/<ScriptName>.ts
```
99 changes: 99 additions & 0 deletions deployment/config/config-types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import { ChainId } from "@wormhole-foundation/sdk-base";

// TODO: check if solana has different needs for the TokenRouter
export type TokenRouterConfiguration = {
// Wormhole Chain ID of the token router configuration
chainId: ChainId;

// Mutable values
/**
* Account with the authority to add
* new token routers among other operations.
*/
ownerAssistant: string;
fastTransferParameters: {
enabled: boolean;
/**
* Expressed in μUSDC.
* E.g. 1000000000 is 1000 USDC.
*/
maxAmount: string;
/**
* Expressed in μUSDC.
* E.g. 1250000 is 1.25 USDC.
*/
baseFee: string;
/**
* Expressed in μUSDC.
* E.g. 950000 is 0.95 USDC.
*/
initAuctionFee: string;
};
cctpAllowance: string;
disableRouterEndpoints?: ChainId[];
};

export type MatchingEngineConfiguration = {
/**
* Wormhole Chain ID of the matching engine configuration
*/
chainId: ChainId;

// Immutable values
/**
* The part of the penalty that is awarded to the user when the auction is completed.
* E.g. 400000 is 40%.
*/
userPenaltyRewardBps: string;
/**
* The initial penalty proportion that is incurred once the grace period is over.
* E.g. 250000 is 25%.
*/
initialPenaltyBps: string;
/**
* Auction duration in Solana slots.
*/
auctionDuration: string;
/**
* Auction grace period in Solana slots.
* The grace period of the auction in slots. This is the number of slots the highest bidder
* has to execute the fast order before incurring a penalty.
* This value INCLUDES the `auctionDuration`.
*/
auctionGracePeriod: string;
/**
* The `securityDeposit` decays over this period.
* Expressed in Solana slots.
*/
auctionPenaltySlots: string;
/**
* minimum offer increment for auctions.
* New offers need to surpass a threshold given by this parameter.
* E.g. 50000 is 5%.
*/
minOfferDeltaBps: string;
/**
* The base security deposit, which will the the additional amount an auction participant must
* deposit to participate in an auction. Expressed in μUSDC.
* E.g. 1000000 is 1 USDC.
*/
securityDepositBase: string;
/**
* Additional security deposit based on the notional of the order amount.
* E.g. 5000 is 0.5%.
*/
securityDepositBps: string;

// Mutable values
/**
* Solana account with the authority to add
* new token routers among other operations.
*/
ownerAssistant: string;
/**
* Fee recipient for relayer service of slow orders, i.e. those that do not
* have an associated auction.
*/
feeRecipient: string;
cctpAllowance: string;
};
142 changes: 142 additions & 0 deletions deployment/config/mainnet/contracts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"TokenRouterProxy": [
{
"chainId": 1,
"address": "28topqjtJzMnPaGFmmZk68tzGmj9W9aMntaEK3QkgtRe"
},
{
"chainId": 30,
"address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47",
"constructorArgs": [
"0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965",
"0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000"
]
},
{
"chainId": 23,
"address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47",
"constructorArgs": [
"0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965",
"0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000"
]
},
{
"chainId": 24,
"address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47",
"constructorArgs": [
"0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965",
"0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000"
]
},
{
"chainId": 6,
"address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47",
"constructorArgs": [
"0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965",
"0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000"
]
},
{
"chainId": 2,
"address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47",
"constructorArgs": [
"0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965",
"0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000"
]
},
{
"chainId": 5,
"address": "0x70287c79ee41C5D1df8259Cd68Ba0890cd389c47",
"constructorArgs": [
"0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965",
"0x439fab9100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014420e8aa32c31626f7f31d6fcc154eeccd6e6e9cb000000000000000000000000"
]
}
],
"UpgradeManager": [
{
"chainId": 1,
"address": "4jyJ7EEsYa72REdD8ZMBvHFTXZ4VYGQPUHaJTajsK8SN"
}
],
"TokenRouterImplementation": [
{
"chainId": 30,
"address": "0xB2BCa2A79f7C99aA684A14303d368ffDbc4307e9",
"constructorArgs": [
"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6",
"0x1682Ae6375C4E4A97e4B583BC394c861A46D8962",
1,
"0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2",
"0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6",
5
]
},
{
"chainId": 23,
"address": "0xB2BCa2A79f7C99aA684A14303d368ffDbc4307e9",
"constructorArgs": [
"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"0xa5f208e072434bC67592E4C49C1B991BA79BCA46",
"0x19330d10D9Cc8751218eaf51E8885D058642E08A",
1,
"0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2",
"0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6",
5
]
},
{
"chainId": 2,
"address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965",
"constructorArgs": [
"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B",
"0xBd3fa81B58Ba92a82136038B25aDec7066af3155",
1,
"0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2",
"0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6",
5
]
},
{
"chainId": 6,
"address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965",
"constructorArgs": [
"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
"0x54a8e5f9c4CbA08F9943965859F6c34eAF03E26c",
"0x6B25532e1060CE10cc3B0A99e5683b91BFDe6982",
1,
"0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2",
"0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6",
5
]
},
{
"chainId": 24,
"address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965",
"constructorArgs": [
"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"0xEe91C335eab126dF5fDB3797EA9d6aD93aeC9722",
"0x2B4069517957735bE00ceE0fadAE88a26365528f",
1,
"0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2",
"0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6",
5
]
},
{
"chainId": 5,
"address": "0xE33C682aA6F7F6E31F0E861aAcCd7dB9C002B965",
"constructorArgs": [
"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
"0x7A4B5a56256163F07b2C80A7cA55aBE66c4ec4d7",
"0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE",
1,
"0x74e70ed52464f997369bbefd141d8a2d9dd3cd15e1f21b37bce18f45e0e923b2",
"0xf4c8473a0e8fb093ca12970ed615db09f7ebbbb3d00f40b3e285e12f40e5c9a6",
5
]
}
]
}
44 changes: 44 additions & 0 deletions deployment/config/mainnet/dependencies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[
{
"chainId": 1,
"matchingEngineProxy": "HtkeCDdYY4i9ncAxXKjYTx8Uu3WM8JbtiLRYjtHwaVXb",
"custodianMatchingEngine": "8sLeDrpnUfSv69KXzKMKMVTpxP7D8iPue5QrHJgyu5XP",
"matchingEngineMintRecipient": "HUXc7MBf55vWrrkevVbmJN8HAyfFtjLcPLBt9yWngKzm"
},
{
"chainId": 2,
"wormhole": "0x98f3c9e6E3fAce36bAAd05FE09d375Ef1464288B",
"token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"tokenMessenger": "0xBd3fa81B58Ba92a82136038B25aDec7066af3155"
},
{
"chainId": 5,
"wormhole": "0x7A4B5a56256163F07b2C80A7cA55aBE66c4ec4d7",
"token": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
"tokenMessenger": "0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE"
},
{
"chainId": 6,
"wormhole": "0x54a8e5f9c4CbA08F9943965859F6c34eAF03E26c",
"token": "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
"tokenMessenger": "0x6B25532e1060CE10cc3B0A99e5683b91BFDe6982"
},
{
"chainId": 23,
"wormhole": "0xa5f208e072434bC67592E4C49C1B991BA79BCA46",
"token": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"tokenMessenger": "0x19330d10D9Cc8751218eaf51E8885D058642E08A"
},
{
"chainId": 24,
"wormhole": "0xEe91C335eab126dF5fDB3797EA9d6aD93aeC9722",
"token": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
"tokenMessenger": "0x2B4069517957735bE00ceE0fadAE88a26365528f"
},
{
"chainId": 30,
"wormhole": "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"tokenMessenger": "0x1682Ae6375C4E4A97e4B583BC394c861A46D8962"
}
]
Loading
Loading