Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function makeDatum(string dataStr) payable returns (bool) {
- debug("datum");
- data[msg.sender].payment += msg.value;
- }
- Here is my Datum struct:
- struct Datum {
- bool exists;
- bytes32 name;
- uint payment;
- }
- data[msg.sender] += msg.value;
- contract.methods.makeDatum("test").estimateGas({from: defaultAccount}, function(error, gas) {
- console.log("Gas estimate:" + gas);
- contract.methods.makeDatum("test").send({from: defaultAccount, gas:gas, value: 50000}, function(error, result) {
- console.log(result);
- console.log("error:" + JSON.stringify(error));
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement