0

here is my Solidity snippet:

function deliverPrizes(address payable winner) public onlyOwner{ 
    winner.transfer(address(this).balance);
}

This is what I wrote on truffle console:

dCoders.deployed().then((i)=>{
     return
         i.deliverPrizes.sendTransaction('0xd2Bd7C19D539c2F080f70Db89f6a345f6673Abe6',
         {from:'0xF198c57CEfD8899Fb0759883B2b1Aa041E0dD599'})
})

But the transaction is:

{ tx: '0xffde0828da8362ed214df1dc75fdcbc279ccdcdbfaf8aa06d7341fc6b98a58a6',
    receipt:
    { 
        transactionHash: '0xffde0828da8362ed214df1dc75fdcbc279ccdcdbfaf8aa06d7341fc6b98a58a6',
        transactionIndex: 0,
        blockHash:   '0x25e86d226fec25db3ed06b2a57943a03931e213d9180e90cfd8ad54e60a84a3f',
        blockNumber: 34,
        from: '0x0d67e3546769b104b67cb719427e9c79b3fb3bcf',
        to: '0xf198c57cefd8899fb0759883b2b1aa041e0dd599',
        gasUsed: 29513,
        cumulativeGasUsed: 29513,
        contractAddress: null,
        logs: [],
        status: true,
        logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000800000000000000000000000000000000000000000000000000000000000000000400000000080000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000002000000000000000000000000',
        v: '0x1c',
        r: '0x6b260f24839b98cccf459c20a6f3d5e92ca3208db97ad44370ea9afceb5307da',
        s: '0x6200005b196f2da06d1cc4d2f91447133b7f7a9ac671a9be54c21e635e7bd59c',
        rawLogs: [ [Object] ] 
    },
logs: [] 
}

So it is from owner's account to winner's one, not from contract address's one. Also no amount is being deducted from owner's account, since the transaction only includes gas fee.

4
  • I'm confused, in the transaction receipt I see from: '0x0d67e3546769b104b67cb719427e9c79b3fb3bcf', to: '0xf198c57cefd8899fb0759883b2b1aa041e0dd599', but from the command you use "from:'0xF198c57CEfD8899Fb0759883B2b1Aa041E0dD599'". Am I missing something? Commented Jan 19, 2019 at 13:22
  • I'm also confused with this thing..So i pasted snippets as it is.
    – Hrishabh
    Commented Jan 19, 2019 at 14:14
  • This is a duplicate. Two solid answers over here: ethereum.stackexchange.com/questions/65660/…. Why don't you respond to the people who have tried to help? Commented Jan 19, 2019 at 15:45
  • 1
    @user9851564 your only argument is 0xd2Bd7C19D539c2F080f70Db89f6a345f6673Abe6, which is nowhere to be seen in the tx receipt. To ensure this is really the transaction corresponding to your call, find the argument value in tx input data.
    – Utgarda
    Commented Jan 21, 2019 at 15:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.