我的目标是在调用loanDuration safeTransferFrom方法时向onERC721Received函数发送一个ERC721 (例如,1天、2天)值。
function onERC721Received(
address,
address from,
uint256 tokenId,
bytes calldata
)
external
override
returns(bytes4)
{
uint256 loanId = uint256(keccak256(abi.encode(address(msg.sender), tokenId)));
loans[loanId] = Loan({
_tokenContract: ERC721(msg.sender),
tokenId: tokenId,
borrower: from,
loanValue: 0,
loanDuration: calldata,
repayable: false
});
lend(from, msg.sender, tokenId);
return 0x150b7a02;
}但是,当我在我的贷款结构中包括loanDuration: calldata时,我会得到以下错误:
ParserError: Expected primary expression.
有什么好主意吗?
https://ethereum.stackexchange.com/questions/115238
复制相似问题