Hi,
I’m trying to follow the example about GNS, here https://docs.openzeppelin.com/learn/sending-gasless-transactions
But when I try to compile the contracts, I have the error
contracts/Counter.sol:5:21: DeclarationError: Identifier not found or not unique.
contract Counter is GSNRecipient {
I saw similar issues but did not resolve mine with this solutions. I installed the latest truffle and I’m on ubuntu.
Any Idea?
Environment
Ubuntu 18.04
“@openzeppelin/network”: “^0.4.2”
“@openzeppelin/cli”: “^2.8.2”,
“@openzeppelin/contracts-ethereum-package”: “^3.0.0”,
“@openzeppelin/gsn-helpers”: “^0.2.3”,
“@openzeppelin/upgrades”: “^2.8.0”,
“ganache-cli”: “^6.9.1”
Truffle v5.1.34 (core: 5.1.34)
Details
Source “@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol” not found: File import callback not supported
Code to reproduce
pragma solidity >=0.6.0;
import "@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol";
contract Counter is GSNRecipient {
uint256 public value;
function increase() public {
value += 1;
}
function acceptRelayedCall(
address relay,
address from,
bytes calldata encodedFunction,
uint256 transactionFee,
uint256 gasPrice,
uint256 gasLimit,
uint256 nonce,
bytes calldata approvalData,
uint256 maxPossibleCharge
) external view returns (uint256, bytes memory) {
return _approveRelayedCall();
}
// We won't do any pre or post processing, so leave _preRelayedCall and _postRelayedCall empty
function _preRelayedCall(bytes memory context) internal returns (bytes32) {
}
function _postRelayedCall(bytes memory context, bool, uint256 actualCharge, bytes32) internal {
}
}