From b4feefc86fea5ace3ec29ed0910884dc7e6d9775 Mon Sep 17 00:00:00 2001 From: MM Date: Sun, 6 Oct 2024 02:46:39 +0200 Subject: [PATCH] stubs --- packages/hardhat/contracts/payWithEth.sol | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/hardhat/contracts/payWithEth.sol b/packages/hardhat/contracts/payWithEth.sol index ab3aa2e..33212f3 100644 --- a/packages/hardhat/contracts/payWithEth.sol +++ b/packages/hardhat/contracts/payWithEth.sol @@ -24,14 +24,21 @@ contract NunyaBusiness { constructor(address _gateway) { gateway == _gateway; + secretContract.retreivePubkey(); } modifier onlyGateway { - require (gateway, "No gateway set"); + require (gateway!=address(0), "No gateway set"); require (msg.sender==gateway, "Only gateway can call callbacks. Use the user function instead"); _; } + function setSecretContractPubkey (bytes32 _key) public onlyGateway { + require (secretContractPubkey==bytes32(0), "Key already set"); + // TODO: Make sure it's our secret contract setting the key, not some interloper + secretContractPubkey=_key; + } + // Function wrapped in secret network payload encryption function makeRef(string calldata secret) public returns (string memory){ string memory ref = secretContract.makeRef(secret);