Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou committed Nov 13, 2024
1 parent cadb56c commit 0c0b110
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 76 deletions.
5 changes: 3 additions & 2 deletions substrate/frame/revive/rpc/examples/js/src/piggy-bank.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { provider, call, getContract, deploy } from './lib.ts'
import { parseEther } from 'ethers'
import { PiggyBank } from '../types/ethers-contracts/PiggyBank'

try {
Expand All @@ -7,14 +8,14 @@ try {
const address = await contract.getAddress()

let receipt = await call('deposit', address, abi, [], {
value: 10_000_000_000n,
value: parseEther('10.0'),
})
console.log('Deposit receipt:', receipt?.status)
console.log(`Contract balance: ${await provider.getBalance(address)}`)

console.log('deposit: ', await contract.getDeposit())

receipt = await call('withdraw', address, abi, [2_000_000_000n])
receipt = await call('withdraw', address, abi, [parseEther('5.0')])
console.log('Withdraw receipt:', receipt?.status)
console.log(`Contract balance: ${await provider.getBalance(address)}`)
console.log('deposit: ', await contract.getDeposit())
Expand Down
Loading

0 comments on commit 0c0b110

Please sign in to comment.