Hi, I am currently working on my own project, but my compile fails due to a declaration error with the sendValue() function within Address.sol.
Here is the code handling the inheritance and constructor of my contract:
pragma solidity ^0.8.0;
// This is an open source for the ERC721 Token Standard
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Address.sol";
contract nftSmartContract is ERC721 {
using Counters for Counters.Counter;
using Address for address;
Counters.Counter private _tokenIdTracker;
string private _baseTokenURI;
bool lock = false;
event Sent(address indexed payee, uint256 amount, uint256 balance);
event Received(address indexed payer, uint tokenId, uint256 amount, uint256 balance);
constructor(string memory name, string memory symbol, string memory baseTokenURI) ERC721(name, symbol) {
_baseTokenURI = baseTokenURI;
}
Here is the function that calls the sendValue() function:
//gets called in the tokenSale() function
//sends the eth from the buyer to the seller, with commission held within this contract
function salePayout(
address payable _payee,
uint256 _value
)
internal
{
require(_payee != address(0) && _payee != address(this), "the person you are trying to payout to is the '0' address or this address");
require(_value > 0 && _value <= address(this).balance, "there is not enough eth in this contract to send to the payee");
require(!lock, "function is currently locked, failing due to potential re-entry attack");
lock = true;
sendValue(_payee, _value);
emit Sent(_payee, _value, address(this).balance);
lock = false;
}
Here is the compile error I am receiving:
DeclarationError: Undeclared identifier.
--> /C/Users/Brend/Documents/Programming/SpaceForce/ContractService/SmartContract/contracts/nftSmartContract.sol:79:9:
|
79 | sendValue(_payee, _value);
|
I have imported Address.sol into my contract, so I am unsure as to why it is unable to see the function.
Any help or guidance is appreciated!