mirror of
https://github.com/status-im/nim-dagger.git
synced 2025-01-12 15:44:18 +00:00
df729be261
* [marketplace] support removal of Storage contract * [marketplace] change submod dep dagger-contracts to codex-contracts-eth
16 lines
734 B
Nim
16 lines
734 B
Nim
import codex/contracts
|
|
import codex/contracts/testtoken
|
|
|
|
proc mint*(signer: Signer, amount = 1_000_000.u256) {.async.} =
|
|
## Mints a considerable amount of tokens and approves them for transfer to
|
|
## the Marketplace contract.
|
|
let token = TestToken.new(!deployment().address(TestToken), signer)
|
|
let marketplace = Marketplace.new(!deployment().address(Marketplace), signer)
|
|
await token.mint(await signer.getAddress(), amount)
|
|
await token.approve(marketplace.address, amount)
|
|
|
|
proc deposit*(signer: Signer) {.async.} =
|
|
## Deposits sufficient collateral into the Marketplace contract.
|
|
let marketplace = Marketplace.new(!deployment().address(Marketplace), signer)
|
|
await marketplace.deposit(await marketplace.collateral())
|