diff --git a/examples/onchain-signer/contracts/Gasless.sol b/examples/onchain-signer/contracts/Gasless.sol index c1716987..806581ab 100644 --- a/examples/onchain-signer/contracts/Gasless.sol +++ b/examples/onchain-signer/contracts/Gasless.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.19; +import {encryptCallData} from "@oasisprotocol/sapphire-contracts/contracts/CalldataEncryption.sol"; import {EIP155Signer} from "@oasisprotocol/sapphire-contracts/contracts/EIP155Signer.sol"; struct EthereumKeypair { @@ -26,7 +27,6 @@ contract Gasless { ) external view returns (bytes memory output) { bytes memory data = abi.encode(innercallAddr, innercall); - // Call will invoke proxy(). return EIP155Signer.sign( kp.addr, @@ -37,7 +37,7 @@ contract Gasless { gasLimit: 250000, to: address(this), value: 0, - data: abi.encodeCall(this.proxy, data), + data: encryptCallData(abi.encodeCall(this.proxy, data)), chainId: block.chainid }) ); diff --git a/examples/onchain-signer/test/CommentBox.ts b/examples/onchain-signer/test/CommentBox.ts index 5699a23e..48136601 100644 --- a/examples/onchain-signer/test/CommentBox.ts +++ b/examples/onchain-signer/test/CommentBox.ts @@ -56,7 +56,7 @@ describe('CommentBox', function () { const provider = ethers.provider; // You can set up sapphire-localnet image and run the test like this: - // docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/sapphire-localnet -to 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 + // docker run -it -p8544-8548:8544-8548 ghcr.io/oasisprotocol/sapphire-localnet // npx hardhat test --grep proxy --network sapphire-localnet const chainId = (await provider.getNetwork()).chainId; if (chainId == BigInt(1337)) {