nebulasio / wiki

This repository is out of date, please check the new wiki:
http://wiki.nebulas.io/en/latest/
GNU General Public License v3.0
421 stars 154 forks source link

可以免gas提现吗? #107

Open qazujmko opened 6 years ago

qazujmko commented 6 years ago
myneb.api.call({
    from: dapp_address,
    to: dapp_address,
    value: 0,
    contract: {
        function: "withdraw",
        args: JSON.stringify(['n1Rs4R8EA7TNjvAyWexkecS2dEJLKhdiyLc', 5000000])
    },
    gasPrice: 1000000,
    gasLimit: 2000000,
}).then(function(tx) {
    console.log(tx);
});

大概是这个意思,我这显示成功但并没有真正到账

liuzhangjie commented 6 years ago

call方法只是返回运行结果,不上链执行

qazujmko commented 6 years ago

就是不能呗...还想做个发红包呢

yupnano commented 6 years ago

Call只是模拟执行,是为了测试执行结果和执行错误,合约的调用只是在当前节点运行,运行结果不会上链。要想使交易生效,需要改用sendTransaction来发送,上链的交易肯定要花费gas的。

weiht12 commented 5 years ago

你好,此版本为星云旧版wiki,欢迎将您的问题提交星云新版wiki,以便于及时与星云开发人员及其他社区开发者进行交流。同时,参与wiki的编辑维护工作还会有奖励哦。新版wiki链接:https://wiki.nebulas.io/en/latest/ (英文);https://wiki.nebulas.io/zh_CN/latest/ (中文) Hello, this version is the nebulas old wiki (later stop maintenance), welcome to submit your question to the new nebulas wiki, in order to get timely answers. At the same time, there will be rewards for editing and maintaining the wiki. New wiki link: https://wiki.nebulas.io/en/latest/ (English); https://wiki.nebulas.io/zh_CN/latest/ (Chinese)