-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
45 additions
and
7 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 @@ | ||
0x737ee2f87ce571a58c6c8da558ec18a07ceb64a6172d5ec46171fbc80077a48: 0.1.0 (goerli-1, goerli-2) |
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
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,33 @@ | ||
import "dotenv/config"; | ||
import { declareContract, deployer, deployMultisig, loadContract, provider } from "../tests/lib"; | ||
|
||
const multisigClassHash = await declareContract("ArgentMultisig", true); | ||
console.log("ArgentMultisig class hash:", multisigClassHash); | ||
const testDappClassHash = await declareContract("TestDapp", true); | ||
console.log("TestDapp class hash:", testDappClassHash); | ||
|
||
console.log("Deploying new account"); | ||
|
||
const threshold = 1; | ||
const signersLength = 2; | ||
const { account, keys, signers } = await deployMultisig(multisigClassHash, threshold, signersLength); | ||
|
||
console.log("Account address:", account.address); | ||
console.log("Account signers:", signers); | ||
console.log( | ||
"Account private keys:", | ||
keys.map(({ privateKey }) => privateKey), | ||
); | ||
|
||
console.log("Deploying new test dapp"); | ||
const { contract_address } = await deployer.deployContract({ classHash: testDappClassHash }); | ||
console.log("TestDapp address:", contract_address); | ||
const testDappContract = await loadContract(contract_address); | ||
|
||
console.log("Calling test dapp"); | ||
testDappContract.connect(account); | ||
const response = await testDappContract.set_number(42n); | ||
await provider.waitForTransaction(response.transaction_hash); | ||
|
||
const number = await testDappContract.get_number(account.address); | ||
console.log(number === 42n ? "Seems good!" : "Something went wrong :("); |
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
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