我有一份合同
contract tokenEvents
{
event globalEvent(address contractAddress, string eventName, uint value);
event globalEvent2(address contractAddress, string eventName, uint value, address senderAddress);
function callEvent(string eventName, uint value)
{
globalEvent(msg.sender, eventName, value);
}
function callEvent2(string eventName, uint value, address senderAddress)
{
globalEvent2(msg.sender, eventName, value, senderAddress);
}
}另一项合同用于上述合同,如
function(){
uint amount = msg.value;
amountRaised += amount;
tokenEvents te = tokenEvents(0x5488845db957f6fd3691b0c2959b607dc52f09b2);
uint nValue;
address senderAddress;
if (msg.sender == partyone){
if (contribution[partyone] == 0)
{
contribution[partyone] = amount;
}
else
{
contribution[partyone] += amount;
}
eventName = "party1_contribution";
nValue = contribution[partyone];
senderAddress = partyone;
}
else if (msg.sender != beneficiary) {
partytwo = msg.sender;
if (contribution[partytwo] == 0){
contribution[partytwo] = amount;
} else {
contribution[partytwo] += amount;
}
eventName = "party2_contribution";
nValue = contribution[partytwo];
senderAddress = partytwo;
}
else {
if (contribution[msg.sender] == 0){
contribution[msg.sender] = amount;
} else {
contribution[msg.sender] += amount;
}
eventName = "other_contribution";
nValue = contribution[msg.sender];
senderAddress = msg.sender;
}
te.callEvent2(eventName, nValue, senderAddress);
}现在,每当我给乙醚一些乙醚到这个合同,它需要太多的气体。例如: 20000
有什么问题吗?
发布于 2016-05-07 14:43:45
21000气体是标准、非合同交易所需的气体.你需要根据计算量来增加气体。
所有的气体都被退还了,所以最简单的方法是用100 K的气体进行交易,在以太扫描时去TX,看看它最终使用了多少气体。将来你可以使用这个数额。
https://ethereum.stackexchange.com/questions/3691
复制相似问题