diff --git a/codex/contracts/config.nim b/codex/contracts/config.nim index d97c7786..fd6a1fa8 100644 --- a/codex/contracts/config.nim +++ b/codex/contracts/config.nim @@ -17,13 +17,15 @@ type period*: UInt256 # proofs requirements are calculated per period (in seconds) timeout*: UInt256 # mark proofs as missing before the timeout (in seconds) downtime*: uint8 # ignore this much recent blocks for proof requirements + zkeyHash*: string # hash of the zkey file which is linked to the verifier func fromTuple(_: type ProofConfig, tupl: tuple): ProofConfig = ProofConfig( period: tupl[0], timeout: tupl[1], - downtime: tupl[2] + downtime: tupl[2], + zkeyHash: tupl[3] ) func fromTuple(_: type CollateralConfig, tupl: tuple): CollateralConfig = diff --git a/codex/contracts/market.nim b/codex/contracts/market.nim index 538b44ac..01b3fd32 100644 --- a/codex/contracts/market.nim +++ b/codex/contracts/market.nim @@ -38,6 +38,11 @@ proc approveFunds(market: OnChainMarket, amount: UInt256) {.async.} = discard await token.increaseAllowance(market.contract.address(), amount).confirm(1) +method getZkeyHash*(market: Market): Future[?string] {.async.} = + let config = await market.contract.config() + let period = config.proofs.period + return + method getSigner*(market: OnChainMarket): Future[Address] {.async.} = return await market.signer.getAddress() diff --git a/codex/market.nim b/codex/market.nim index bf78ddeb..88179570 100644 --- a/codex/market.nim +++ b/codex/market.nim @@ -30,6 +30,9 @@ type expiry*: UInt256 ProofChallenge* = array[32, byte] +method getZkeyHash*(market: Market): Future[?string] {.base, async.} = + raiseAssert("not implemented") + method getSigner*(market: Market): Future[Address] {.base, async.} = raiseAssert("not implemented") diff --git a/vendor/codex-contracts-eth b/vendor/codex-contracts-eth index b5f33992..d4007711 160000 --- a/vendor/codex-contracts-eth +++ b/vendor/codex-contracts-eth @@ -1 +1 @@ -Subproject commit b5f33992b67df3733042a7d912c854700e8c863c +Subproject commit d40077118dd552b44d20830d0510934d36e5cd97