构造函数错误,设置器不起作用(坚固)
我正在从事智能合同项目,当我将提出一些价值观时,在合同的分散时作为输入,我遇到了一个说法。
“还原 交易已恢复为初始状态。 注意:如果发送值和 您发送的价值应小于当前余额。 调试交易以获取更多信息。”
我的代码是
uint[] private Info;
function SetInfo(uint[] memory data) private onlyOwner{
Info = new uint[](data.length);
for(uint i = 0; i < data.length;i++){
Info[i] = data[i];
}
constructor(uint[] memory _Info,uint[] memory _SecondInfo)
ERC721(_name, _symbol) {
SetInfo(_Info);
SetSecondInfo(_SecondInfo)
}
I was working on my smart contract project and when I put some values at the depolyment of the contract as inputs and I got an error of saying.
"revert
The transaction has been reverted to the initial state.
Note: The called function should be payable if you send value and the
value you send should be less than your current balance.
Debug the transaction to get more information."
And my code is
uint[] private Info;
function SetInfo(uint[] memory data) private onlyOwner{
Info = new uint[](data.length);
for(uint i = 0; i < data.length;i++){
Info[i] = data[i];
}
constructor(uint[] memory _Info,uint[] memory _SecondInfo)
ERC721(_name, _symbol) {
SetInfo(_Info);
SetSecondInfo(_SecondInfo)
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我试图调整您的智能合同。我提出了一些评论,可以帮助您了解我的所作所为以及原始智能合约中的错误。
智能合约代码:
I tried to adjust your smart contract. I put some comments that will help you to understand what I did and your errors in original smart contract.
Smart contract code: