iost.js
iost.js copied to clipboard
Remove redundancy statement on iost.transfer
let t = this.callABI("token.iost", "transfer", [token, from, to, amount, memo]);
In above statement, this.callABI
already do t.addApprove("*", this.config.defaultLimit);
internally.
So there is no reason to set defaultGasLimit twice when call transfer
.
cf)
-
callABI
function
callABI(contract, abi, args) {
const t = new Tx(this.config.gasRatio, this.config.gasLimit);
t.addAction(contract, abi, JSON.stringify(args));
t.setTime(this.config.expiration, this.config.delay);
t.addApprove("*", this.config.defaultLimit); // already approve defaultLimit!
return t
}
-
transfer
function
transfer(token, from, to, amount, memo = "") {
let t = this.callABI("token.iost", "transfer", [token, from, to, amount, memo]);
t.addApprove("*", this.config.defaultLimit); // redundant!
t.addApprove("iost", amount);
return t;
}