2023-05-03 07:24:25 +00:00
|
|
|
import std/os
|
2023-06-21 05:46:18 +00:00
|
|
|
import std/options
|
2023-05-03 07:24:25 +00:00
|
|
|
import pkg/ethers
|
|
|
|
import pkg/codex/contracts/marketplace
|
|
|
|
|
2024-02-07 06:50:35 +00:00
|
|
|
const hardhatMarketAddress =
|
|
|
|
Address.init("0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44").get()
|
|
|
|
const hardhatMarketWithDummyVerifier =
|
|
|
|
Address.init("0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f").get()
|
2023-05-03 07:24:25 +00:00
|
|
|
const marketAddressEnvName = "CODEX_MARKET_ADDRESS"
|
|
|
|
|
2024-02-07 06:50:35 +00:00
|
|
|
proc address*(_: type Marketplace, dummyVerifier = false): Address =
|
2023-05-03 07:24:25 +00:00
|
|
|
if existsEnv(marketAddressEnvName):
|
|
|
|
without address =? Address.init(getEnv(marketAddressEnvName)):
|
|
|
|
raiseAssert "Invalid env. variable marketplace contract address"
|
|
|
|
|
|
|
|
return address
|
|
|
|
|
2024-02-07 06:50:35 +00:00
|
|
|
if dummyVerifier:
|
|
|
|
hardhatMarketWithDummyVerifier
|
|
|
|
else:
|
|
|
|
hardhatMarketAddress
|
2023-05-03 07:24:25 +00:00
|
|
|
|