| 函数 | 参数 | 返回值 | 说明 |
|---|---|---|---|
mintBatch |
address to: 接收人 |
||
uint256[] memory ids: POAP ID列表 |
|||
uint256[] memory amounts: POAP数量列表,与ID一一对应 |
无 | 批量发送徽章 |
每次给一个人批量发送所有POAP,两个列表ids需要和amouns长度一致 |
| verify | address to: 接收人
uint256[] memory ids: POAP ID列表
uint256[] memory amounts: POAP数量列表,与ID一一对应
uint256 timestamp:时间戳
bytes memory signature:签名 | bool:
true 合法/有效
false非法/无效 | 验证签名是否合法
在claim之前提前验证,防止交易回滚。 |
| claim | uint256[] memory ids: POAP ID列表
uint256[] memory amounts: POAP数量列表,与ID一一对应
uint256 timestamp:时间戳
bytes memory signature:签名 | 无 | 免费领取POAP徽章
所需全部数据由后端提供。 |
| mint | address to: 接收人
uint256 id: POAP ID
uint256 amount: POAP数量 | 无 | 发放徽章
给某一个人发送某一种徽章,数量可以是多个。 |
前端claim所需参数及签名需要后端动态提供,使用如下接口获取
/poap/rewards?address={address}result: 0,失败,1,成功error: 失败原因,成功时不返回或为空idList: id列表,整数数组amountList: 数量列表,整数数组timestamp: 时间戳signature: 签名如果该账户没有POAP可领取,则返回result = 1,其他字段为空。