ERC-1155:
function approve(address _spender, uint256 _id, uint256 _currentValue, uint256 _value) external;
/**
@dev Allow other accounts/contracts to spend tokens on behalf of msg.sender
Also, to minimize the risk of the approve/transferFrom attack vector
(see https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/), this function will throw if the current approved allowance does not equal the expected _currentValue, unless _value is 0
@param _spender Address to approve
@param _ids IDs of the CryptoItems
@param _currentValues Expected current values of allowances per item type
@param _values Allowance amounts per item type
*/
function batchApprove(address _spender, uint256[] calldata _ids, uint256[] calldata _currentValues, uint256[] calldata _values) external;这两个函数应该发出哪些事件(以及使用哪些参数)?
发布于 2021-01-08 12:52:54
这两个功能不是EIP-1155 (https://eips.ethereum.org/EIPS/eip-1155)的一部分.事实上,EIP只定义了:
/**
@notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
@dev MUST emit the ApprovalForAll event on success.
@param _operator Address to add to the set of authorized operators
@param _approved True if the operator is approved, false to revoke approval
*/
function setApprovalForAll(address _operator, bool _approved) external;但是,您提到的方法approve已经实现了这里,作为对ERC1155契约的扩展,以便允许特定Ids使用。
发布于 2021-08-24 19:04:07
ERC-1155规范推荐EIP-1761作用域审批接口作为允许特定令牌批准的方法:https://eips.ethereum.org/EIPS/eip-1761
https://ethereum.stackexchange.com/questions/88250
复制相似问题