blockchain - 使用 Solidity 中的 hexdata 从已部署的合约 abc 调用已部署的合约 xyz 公共应付款功能
问题描述
在地址为 abc 的已部署合同中,我有:
function CallContract(address tosend,uint amount,bytes hexdata,uint zgas) public payable {
tosend.call.gas(zgas).value(amount)(hexdata);
}
在 web3 我有
await AbcContract.methods
.CallContract(this.state.tosend,amounttowei,web3.utils.fromAscii(data),gas)
.send({
from:accounts[0]
});
在地址为 XYZ 的已部署合同中,我有:
uint public some var;
uint public another var;
function DoSomething() public payable {
uint somevar = 1;
}
function DoSomethingAgain(uint justanumber) public payble {
uint anothervar = justanumber;
}
我究竟做错了什么?在 etherscan 我得到“虽然发生了一个或多个错误 [Out of gas] 合同执行已完成”
解决方案
推荐阅读
- linux-kernel - 为什么在 qemu-system-x86_64 上启动 linux 时需要将控制台设置为 ttyS0
- composer-php - Laragon 定义外部 Composer 路径
- java - 如何在java中仅使用不为空的文本字段
- html - 在html css中对齐文本和切换按钮
- node.js - 服务器不加载数据
- php - 文件上传 CURL 命令到 PHP Curl
- installation - 无法接受来自 Pycharm 在 Raspberry Pi 上的隐私政策
- swift - 在使用 UIKit for macOS (Catalyst) 构建的应用程序中生成进程
- c# - SQL 事务死锁。不知道为什么
- flutter - 应用帮助和教程实现