In my contract, there is a struct type:
struct Claim {
address healthcareProvider;
uint amount;
bool patientSig;
bool paid;
uint item;
}
And the initialize function is:
function MakeClaim(uint _amount, uint _item, uint num) {
Claim memory c;
c.healthcareProvider = tx.origin;
c.patientSig = false;
c.paid = false;
c.amount = _amount;
c.item = _item;
}
When I call this function to create a new Claim type, I find the price is 2.687 ETH (not gas). This is much more than the cost for deploying the entire contract! I am testing it on the Morden test net. Where is my problem?
memory
, this is pretty cheap operation for the struct (tens of gas) comparing to storing data instorage
(thousands of gas). Please measure operation/transaction costs in GAS, not in ETH. Maybe you gas price is too high?