Skip to content

Commit

Permalink
use secretjs beta whilst testnet being updated. fixes uploading Nunya…
Browse files Browse the repository at this point in the history
… secret contract
  • Loading branch information
ltfschoen committed Nov 3, 2024
1 parent b7fc6e8 commit 5327898
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 31 deletions.
4 changes: 4 additions & 0 deletions _SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,13 @@ docker rmi sco
> IMPORTANT: Prior to Instantiation step it is necessary to deploy the EVM Gateway
```
yarn install
yarn run secret:clean:uploadContract
yarn run secret:start:uploadContract
```
> IMPORTANT: If deployment of the code with `await secretjs.tx.compute.storeCode` is unsuccessful, then check if Beta version of secretjs is necessary incase the Secret Testnet is being upgraded.
* Query Pubkey
```
yarn run secret:queryPubkey
Expand Down
2 changes: 1 addition & 1 deletion packages/secret-contracts-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/node": "^22.7.4",
"dotenv": "^16.4.5",
"ethers": "^5.7.2",
"secretjs": "^1.12.5",
"secretjs": "1.15.0-beta.0",
"typescript": "^5.6.2"
}
}
9 changes: 8 additions & 1 deletion packages/secret-contracts-scripts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const gatewayHash =
"ad8ca07ffba1cb26ebf952c29bc4eced8319c171430993e5b5089887f27b3f70";
const gatewayPublicKey =
"0x046d0aac3ef10e69055e934ca899f508ba516832dc74aa4ed4d741052ed5a568774d99d3bfed641a7935ae73aac8e34938db747c2f0e8b2aa95c25d069a575cc8b";
const nunyaBusinessContractAddress = "";

// Secret Mainnet
// reference: https://docs.scrt.network/secret-network-documentation/confidential-computing-layer/ethereum-evm-developer-toolkit/supported-networks/secret-gateway/secretpath-mainnet-secret-4-contracts
Expand Down Expand Up @@ -71,6 +72,7 @@ async function main () {
gateway_address: String,
gateway_hash: String,
gateway_key: String,
nunya_business_contract_address: any,
count: Number,
};

Expand Down Expand Up @@ -123,7 +125,11 @@ async function main () {
tx?.arrayLog?.find((log: any) => log?.type === "message" && log?.key === "code_id")?.value
);

console.log("tx.rawLog: ", tx?.rawLog);
if (tx?.rawLog) {
console.log("tx.rawLog: ", tx?.rawLog);
} else {
console.log("tx: ", tx);
}

console.log("codeId: ", codeId);

Expand Down Expand Up @@ -163,6 +169,7 @@ async function main () {
gateway_address: gatewayAddress,
gateway_hash: gatewayHash,
gateway_key: gatewayPublicKeyBytes,
nunya_business_contract_address: nunyaBusinessContractAddress,
count: 1,
};

Expand Down
Loading

0 comments on commit 5327898

Please sign in to comment.