@drortirosh, after successfully running yarn gsn-with-ganache
and yarn start
![image](https://user-images.githubusercontent.com/62002637/216772014-703e9053-74fb-4ff4-bb99-cea915e2fced.png)
![image](https://user-images.githubusercontent.com/62002637/216772026-5930fc85-d499-4551-a4b2-51347586e1c0.png)
When I click on Capture the flag button, I receive errors in the browser console
Console output
calling sendAsync{"method":"eth_sendTransaction","params":[{"gas":"0xb1bb","gasPrice":"0x4a817c800","from":"0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1","to":"0xfc628dd79137395f3c9744e33b1c5de554d94882","data":"0x239e26f2"}],"id":66,"jsonrpc":"2.0"} bundle.js:61918 fetchRelaysAdded: found 1 relays bundle.js:47566 Sending in view mode: {"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"from":"0x0000000000000000000000000000000000000000","to":"0xC89Ce4735882C9F0f0FE26686c53074E09B0D550","gas":"0xb71b00","data":"0xb1a62e720000000000000000000000000000000000000000000000000000000000b71b000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000003200000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000016000000000000000000000000090f8bf6a479f320ead074411a4b0e7944ea8c9c1000000000000000000000000fc628dd79137395f3c9744e33b1c5de554d948820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b1bb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000063e108dc0000000000000000000000000000000000000000000000000000000000000004239e26f20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a817c80000000000000000000000000000000000000000000000000000000004a817c800000000000000000000000000000000000000000000000000000000000000176c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d833215cbcc3f914bd1c9ece3ee7bf8b14f841bb000000000000000000000000254dffcd3277c0b1660f6d42efbb754edababc2b00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","gasPrice":"0x4a817c800"},"latest"]} encoded data: {"relayRequest":{"request":{"to":"0xfc628dd79137395f3c9744e33b1c5de554d94882","data":"0x239e26f2","from":"0x90f8bf6a479f320ead074411a4b0e7944ea8c9c1","value":"0","nonce":"0","gas":"45499","validUntilTime":"1675692252"},"relayData":{"relayWorker":"0x0000000000000000000000000000000000000000","transactionCalldataGasUsed":"0x176c","paymasterData":"0x","maxFeePerGas":"20000000000","maxPriorityFeePerGas":"20000000000","paymaster":"0xD833215cBcc3f914bD1C9ece3EE7BF8B14f841bb","clientId":"1","forwarder":"0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B"}},"signature":"0x","approvalData":"0x","maxAcceptanceBudget":"12000000"} bundle.js:47584 relayCall res=0x0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000f142fc1e9c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000 bundle.js:63097 nextRelay: find fastest relay from: [{"relayManager":"0xc6232031bF6C4858e7BC9eb3e253dBB45C58ef7D","relayUrl":"http://127.0.0.1:36869"}] bundle.js:63153 getRelayAddressPing URL: http://127.0.0.1:36869 bundle.js:63099 race finished with a result: {"errors":{"dataType":"Map","value":[["http://127.0.0.1:36869",{"message":"Network Error","name":"Error","stack":"Error: Network Error\n at createError (http://localhost:3000/bundle.js:68018:15)\n at XMLHttpRequest.handleError (http://localhost:3000/bundle.js:67537:14)","config":{"url":"http://127.0.0.1:36869/getaddr?paymaster=0xD833215cBcc3f914bD1C9ece3EE7BF8B14f841bb","method":"get","headers":{"Accept":"application/json, text/plain, */*"},"transformRequest":[null],"transformResponse":[null],"timeout":15000,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false}}}]]},"results":[]}
Error
![image](https://user-images.githubusercontent.com/62002637/216772094-6034209a-2935-4a67-9242-3759174a6390.png)
Prevsiously when running yarn start
command I was facing below error
Public state variable has override specified but does not override anything. solidity
Becauase in line# 18 string public override versionRecipient = "3.0.0";
the override
specifier is used.
To eliminate this error I removed the override
specifier because compiler says that I am not overriding anything
So now line# 18 is: string public versionRecipient = "3.0.0";
Than yarn start
worked fine.
Below is CaptureTheFlag.sol
/**
* SPDX-License-Identifier:MIT
*/
pragma solidity ^0.8.7;
import "@opengsn/contracts/src/ERC2771Recipient.sol";
contract CaptureTheFlag is ERC2771Recipient {
event FlagCaptured(address previousHolder, address currentHolder);
address public currentHolder = address(0);
constructor(address forwarder) {
_setTrustedForwarder(forwarder);
}
string public versionRecipient = "3.0.0";
function captureTheFlag() external {
address previousHolder = currentHolder;
currentHolder = _msgSender();
emit FlagCaptured(previousHolder, currentHolder);
}
}