我正在使用它,通过反应中的元掩码在智能合约中进行函数调用:
export default class EthereumForm1 extends Component {
constructor (props) {
super (props);
const MyContract = window.web3.eth.contract(ContractABI);
this.state = {
ContractInstance: MyContract.at('ContractAddress')
}
this.doPause = this.doPause.bind (this);
}
doPause() {
const { pause } = this.state.ContractInstance;
pause (
{
gas: 30000,
gasPrice: 32000000000,
value: window.web3.toWei (0, 'ether')
},
(err) => {
if (err) console.error ('Error1::::', err);
console.log ('Contract should be paused');
})
}
我想要的是运行带有加载 gif 的 jQuery 代码:$(".Loading").show();
同时处理事务并在之后将其删除。此外,最好在 div 之后添加事务状态,例如在元掩码中(通过或拒绝)。