- Install Flow CLI: https://docs.onflow.org/flow-cli/install/#gatsby-focus-wrapper
- Change your private key and address in flow.json under "testnet-account" object (you can change it to "mainnet-account" for mainnet)
- If your account uses ECDSA_secp256k1, change "signatureAlgorithm" to "ECDSA_secp256k1"
- In a terminal, run
flow accounts update-contract CONTRACT_NAME PATH_TO_CONTRACT --network=testnet --signer=testnet-account
(or--network=mainnet --signer=mainnet-account
for mainnet)
- Look at main.js for all the source code
- Change
PRIVATE_KEY
,ADDRESS
,KEY_ID
, andCONTRACT_NAME
to yours - If your account uses ECDSA_secp256k1, comment out line 6 in main.js and uncomment line 5
- Put your new contract code on line 49
- If you're using mainnet, change
"https://rest-testnet.onflow.org"
on line 9 to"https://rest-mainnet.onflow.org"
- In a termimal, run
node main.js