3

remix里这段编译错误应该怎么修改源码? | 登链社区 | 技术问答

 3 years ago
source link: https://learnblockchain.cn/question/2368
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
remix里这段编译错误应该怎么修改源码? | 登链社区 | 技术问答

15 remix里这段编译错误应该怎么修改源码?

remix里这段编译错误应该怎么修改?

contracts/szairdrop2.sol:23:9:
 Warning: Return value of low-level calls not used. contract_address.call(id, msg.sender, tos[i], vs[i]);

对应源码:

function transfer(address contract_address,address[] tos,uint[] vs)
public
validAddress(contract_address)
returns (bool){
require(tos.length > 0);
require(vs.length > 0);
require(tos.length == vs.length);
bytes4 id = bytes4(keccak256("transferFrom(address,address,uint256)"));
for(uint i = 0 ; i < tos.length; i++){
    contract_address.call(id, msg.sender, tos[i], vs[i]); //这一行报的错
}
return true;
}

最佳答案 1天前

或者你判断一下call 的返回值。
这是一个警告, 也可以不管。

Tiny熊 - 布道者
擅长:智能合约,以太坊 | 采纳率 39% | 回答于 2天前

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK