trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.03k stars 2.32k forks source link

receipt.to showing contract address #6197

Closed oehm-smith closed 11 months ago

oehm-smith commented 1 year ago

Issue

I wrote about this at https://ethereum.stackexchange.com/questions/154709/metacoin-why-does-send-show-the-contract-address-in-receipt-to/154710#154710 before working out that does seem to be a bug.

After sending (using the MetaCoin test project), the receipt is showing the contract address instead of hte address that the coin was sent to.

Steps to Reproduce

$ truffle unbox metacoin
$ truffle compile  
$ truffle develop
truffle(develop)> let instance = await MetaCoin.deployed()
truffle(develop)> instance
# Note the contract address 
truffle(develop)> let accounts = await web3.eth.getAccounts()
undefined
truffle(develop)> accounts
# Note the list of accounts
truffle(develop)> let result = await instance.sendCoin(accounts[1], 10, {from: accounts[0]})

## Expected Behavior

The result.receipt.to address is the same as `accounts[1]`

## Actual Results

The result.receipt.to address is the same as the `contract address`

## Environment

* Operating System: MacOS 13.5.2
* Ethereum client: Truffle Develop (internal Granache)
* See next ...

truffle(development)> version Truffle v5.11.5 (core: 5.11.5) Ganache v7.9.1 Solidity - 0.8.13 (solc-js) Node v18.17.1 npm: 9.6.7 Web3.js v1.10.0

oehm-smith commented 1 year ago

I guess noone cares given the project is being shuttered.

oehm-smith commented 11 months ago

A comment on that StackExchange question answered:

This would be an evm/smart contract thing, so it should be the same in hardhat. You could get a ton of mileage just working with web3.js and leave the development framework for later. Since as you elude to they are each like learning their own thing and maybe the additional abstraction will get in the way at this stage