2.3.1. 数字积分管理

2.3.1.1. 简介

数字积分管理合约,适用于商户积分等运营活动

2.3.1.1.1. 函数

函数名(name

参数(inputs)

简介(description

initialize

[‘totalSupply: 发行总量。 初始化时,积分全部归合约部署者所有’]

初始化函数,在合约部署时默认执行, 始化积分管理账户以及总发行量

addAward

[‘amount: 增发容量’]

增发积分

totalSupply

[]

获取积分总供应量

balance

[‘caller: 合约调用者’]

取caller的积分余额

allowance

[‘from: 被消费积分的一方’, ‘to: 消费积分的一方’]

查询to用户能消费from用户的积分数量

transfer

[‘from: 转移积分的一方’, ‘to: 收积分的一方’, ‘token: 转移积分数量’]

from账户给to账户转token数量的积分

transferFrom

[‘from: 被转积分账户’, ‘caller: 合约调用者’, ‘to: 收积分账户’, ‘token: 转移的积分数量’]

从授权账户from转移数量为token的积分给to账户

approve

[‘from: 被转积分账户’, ‘caller: 合约调用者’, ‘to: 收积分账户’, ‘token: 转移的积分数量’]

允许to账户从from账户转移token数量的积分