You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before deploying for the first time make sure all program IDs in `lib.rs` and `Anchor.toml` are the same as listed when running `anchor keys list`. If not, update them to match the deployment keypairs under `target/deploy/` and commit the changes.
72
+
73
+
Make sure to use the verified docker binaries that can be built:
74
+
75
+
```shell
76
+
unset IS_TEST # Ensures the production build is used (not the test feature)
export MINT=4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU # This is USDC on devnet, update with address for mainnet
154
+
anchor run createVault \
155
+
--provider.cluster $RPC_URL \
156
+
--provider.wallet $KEYPAIR -- \
157
+
--originToken $MINT
158
+
```
159
+
160
+
#### Upgrades
161
+
162
+
Initiate the program upgrade:
163
+
164
+
```shell
165
+
solana program write-buffer \
166
+
--url $RPC_URL \
167
+
--keypair $KEYPAIR \
168
+
--with-compute-unit-price 50000 \
169
+
--max-sign-attempts 100 \
170
+
--use-rpc \
171
+
target/deploy/$PROGRAM.so
172
+
export BUFFER= # Export the logged buffer address from the command above
173
+
solana program set-buffer-authority \
174
+
--url $RPC_URL \
175
+
--keypair $KEYPAIR \
176
+
$BUFFER \
177
+
--new-buffer-authority $MULTISIG
178
+
```
179
+
180
+
Add the program ID to Squads multisig (`https://devnet.squads.so/` for devnet and `https://app.squads.so/` for mainnet) in the Developers/Programs section. Then add the upgrade filling in the buffer address and buffer refund. After creating the upgrade verify the buffer authority as prompted and proceed with initiating the upgrade. Once all required signers have approved, execute the upgrade in the transactions section.
181
+
182
+
Start the IDL upgrade by writing it to the buffer:
183
+
184
+
```shell
185
+
anchor idl write-buffer \
186
+
--provider.cluster $RPC_URL \
187
+
--provider.wallet $KEYPAIR \
188
+
--filepath target/idl/$PROGRAM.json \
189
+
$PROGRAM_ID
190
+
export IDL_BUFFER= # Export the logged IDL buffer address from the command above
191
+
anchor idl set-authority \
192
+
--provider.cluster $RPC_URL \
193
+
--provider.wallet $KEYPAIR \
194
+
--program-id $PROGRAM_ID \
195
+
--new-authority $MULTISIG \
196
+
$IDL_BUFFER
197
+
```
198
+
199
+
Construct the multisig transaction for finalizing the IDL upgrade. Copy the printed base58 encoded transaction from below command and import it into the Squads multisig for approval and execution:
Start with verifying locally that the deployed program matches the source code of the public repository:
212
+
213
+
```shell
214
+
solana-verify verify-from-repo \
215
+
--url $RPC_URL \
216
+
--program-id $PROGRAM_ID \
217
+
--library-name $PROGRAM \
218
+
https://github.com/across-protocol/contracts
219
+
```
220
+
221
+
When prompted, don't yet upload the verification data to the blockchain as that should be done by the multisig. Proceed with creating the upload transaction and then import and sign/execute it in the Squads multisig:
222
+
223
+
```shell
224
+
solana-verify export-pda-tx \
225
+
--url $RPC_URL \
226
+
--program-id $PROGRAM_ID \
227
+
--library-name $PROGRAM \
228
+
--uploader $MULTISIG \
229
+
https://github.com/across-protocol/contracts
230
+
```
231
+
232
+
Note that the initial upload transaction might fail if the multisig vault does not have enough SOL for PDA creation. In that case, transfer the required funds to the multisig vault before executing the upload transaction.
233
+
234
+
Finally, submit the verification to OtterSec API (only works on mainnet):
0 commit comments