我使用迁移功能在本地松露环境上部署了一个简单的智能合约。我正在使用react-components软件包来处理智能合约。
所以我的问题是简单的getter和setter可以正常工作,但是当我尝试运行带有2-3个参数的方法时,却遇到了这个异常。
我的truffleconfig如下:
draw_year = cells[0].find("a", href=True)
if draw_year is not None:
print(draw_year['href'])
在我的react组件中,我这样调用:
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
contracts_build_directory: path.join(__dirname, "app/src/contracts"),
networks: {
develop: { // default with truffle unbox is 7545, but we can use develop to test changes, ex. truffle migrate --network develop
host: "127.0.0.1",
port: 8545,
network_id: "*",
gas: 6921975,
gasPrice: 25000000000
}
},
solc: {
optimizer: {
enabled: true,
runs: 200
}
}
};
我的求实函数是这样的:
<div className="section">
<h2>Testing Poni</h2>
<p>
This is a initial test to create Poni
</p>
<p>
<strong>Stored Value: </strong>
<ContractData
drizzle={drizzle}
drizzleState={drizzleState}
contract="PoniOwnership"
method="getMyPonies"
/>
</p>
<ContractForm drizzle={drizzle} contract="PoniOwnership" method="createPoni" />
</div>
我尝试从毛毛雨反应成分中另外发送气体,因为此处提供了选项:https://www.trufflesuite.com/docs/drizzle/react/react-components,但是它抛出错误,表明该功能不可用。我无法弄清楚如何处理此异常。
答案 0 :(得分:1)
您要为交易设置更高的费用
您要调整ContractForm组件上的sendArgs({gas:})。
https://www.trufflesuite.com/docs/drizzle/react/react-components#contractform