nim-codex/tests/contracts/deployment.nim
markspanbroek 2cf892c467
Smart contracts update: Groth16Proof instead of bytes (#683)
* Smart contracts update: Groth16Proof instead of bytes

* Use dummy verifier for now, until we can create ZK proofs

* Fix tests: submit proof only when slot is filled

* Submit dummy proofs for now

* More detailed log when proof submission failed

* Use dummy verifier for integration tests

For now at least

* Fix mistake in blanket renaming to ethProvider

* Update to latest codex-contracts-eth

* feat: zkey-hash from chain

* Fix zkeyHash

---------

Co-authored-by: Adam Uhlíř <adam@uhlir.dev>
2024-02-07 07:50:35 +01:00

24 lines
701 B
Nim

import std/os
import std/options
import pkg/ethers
import pkg/codex/contracts/marketplace
const hardhatMarketAddress =
Address.init("0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44").get()
const hardhatMarketWithDummyVerifier =
Address.init("0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f").get()
const marketAddressEnvName = "CODEX_MARKET_ADDRESS"
proc address*(_: type Marketplace, dummyVerifier = false): Address =
if existsEnv(marketAddressEnvName):
without address =? Address.init(getEnv(marketAddressEnvName)):
raiseAssert "Invalid env. variable marketplace contract address"
return address
if dummyVerifier:
hardhatMarketWithDummyVerifier
else:
hardhatMarketAddress