Closed netpoe closed 2 years ago
đ
We can create ConditionEscrow contracts via the EscrowFactory now. Tests working.
near deploy --wasmFile target/wasm32-unknown-unknown/release/escrow_factory.wasm --accountId escrowfactory.testnet --initFunction new
near call fac2.escrowfactory.testnet create_conditional_escrow '{ "name": "ce-1", "public_key": "ed25519:5APMXxJBNEbGWWiSWhWxZMzkLvnB6vdBuDQuzjpkPB7E", "args": "eyJleHBpcmVzX2F0IjoxNjQyNzA4NDgxMjQxMDAwMDAwLCJtaW5fZnVuZGluZ19hbW91bnQiOjEwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAsInJlY2lwaWVudF9hY2NvdW50X2lkIjoic3ZwZXJ2bmRlci50ZXN0bmV0In0=" }' --accountId svpervnder.testnet --gas=300000000000000 --deposit 10
The args need to be base64 encoded (make sure you remove spaces and escape the characters):
args
btoa("{\"expires_at\":1642708481241000000,\"min_funding_amount\":1000000000000000000000000,\"recipient_account_id\":\"svpervnder.testnet\"}")
Examples of calling the deployed ConditionalEscrow:
ConditionalEscrow
near call ce-1.fac2.escrowfactory.testnet get_expiration_date --accountId svpervnder.testnet near call ce-1.fac2.escrowfactory.testnet is_deposit_allowed --accountId svpervnder.testnet near call ce-1.fac2.escrowfactory.testnet is_withdrawal_allowed --accountId svpervnder.testnet
Proof that deposit works: https://wallet.testnet.near.org/profile/ce-1.fac2.escrowfactory.testnet
deposit
near call ce-1.fac2.escrowfactory.testnet deposit --accountId svpervnder.testnet --deposit 10
đ
We can create ConditionEscrow contracts via the EscrowFactory now. Tests working.
To deploy an EscrowFactory contract:
To deploy a ConditionalEscrow contract:
The
args
need to be base64 encoded (make sure you remove spaces and escape the characters):Examples of calling the deployed
ConditionalEscrow
:Proof that
deposit
works: https://wallet.testnet.near.org/profile/ce-1.fac2.escrowfactory.testnet