just to be clear:
the source code submitted to etherscan may not be equivalent to the current compiled code on the chain.
there is no way to easily get a copy of the code from the chain and decompile it.
Nov 21, 2020, 10:35 AM
correct?
Nov 21, 2020, 10:35 AM
The source code submitted to the etherscan must be the same. Even a single space make your verification to fail.
Nov 21, 2020, 10:36 AM
yes BUT after etherscan verifies it, updates can be applied and etherscan does not re-check it, and there is not an easy way for me to confirm whether etherscan source is current or not. is that right?
Nov 21, 2020, 10:37 AM
Updates? You can change the states but not the source code
Nov 21, 2020, 10:38 AM
I'm trying to figure out why token "HATE" does xyz but the contract source code on etherscan only includes functions for z
I'd greatly appreciate if you could help explain to me. That one is just an example, but I learn languages by looking at others' code, and in this example, it went terribly awry.
Nov 21, 2020, 10:39 AM
which contract are you referring to? and the missing functionality
Nov 21, 2020, 10:42 AM
contract 0xe75d3b39d017985caf20fac7134ed55b8b47cc26 .. the token takes a fee on each transaction and transfers it to a uniswap liquidity pool. but in the source, it does none of that.
Nov 21, 2020, 10:46 AM
When you transfer your token to another wallet?
Nov 21, 2020, 10:49 AM
correct
Nov 21, 2020, 10:49 AM
How do u makes sure they actually do that?
Nov 21, 2020, 10:56 AM
@tyler1111 the token advertises that it does that. when you do a transaction, metamask asks you to approve the fee. and you can see the contract address interacting with uniswap.
Nov 21, 2020, 11:00 AM
But the Heavengate's contract address is this one
0x054bd236b42385c938357112f419dc5943687886
And you are referring to this:
0xe75d3b39d017985caf20fac7134ed55b8b47cc26
0x054bd236b42385c938357112f419dc5943687886
And you are referring to this:
0xe75d3b39d017985caf20fac7134ed55b8b47cc26
Nov 21, 2020, 11:02 AM
wow, OK, now I feel dumb. this makes much more sense. so you can study the source using etherscan reliably. awesome!!!
thank you!
Nov 21, 2020, 11:04 AM
Yeah, there are many fake tokens
View doesn't change the state
Nov 21, 2020, 1:04 PM
yes but opcodes will still be there,
that requires some computation by EVM
Nov 21, 2020, 1:04 PM
Call uses your own computational power
Nov 21, 2020, 1:05 PM
that means , if the transaction is sent to the network ,pure and view functions will consume gas.
Nov 21, 2020, 1:08 PM
You can't interact with the smart contracts without any provider.
It can be local node, infura etc
It can be local node, infura etc
Nov 21, 2020, 1:09 PM
got it, only when transaction is broadcast to others it will cost you
Nov 21, 2020, 1:11 PM
view doesn't gets broadcasted to the network
And you can't have any method within a view function which modifies the state.
Nov 21, 2020, 1:13 PM
they cost gas if they are a part of transaction , let's say if you have a public function A() and that call a "view" function from inside and the return value of that "view" function is initialized to a "state variable" already present in the contract inside A(), then i think EVM will also consider the computation of view function
Here these guys said it
https://ethereum.stackexchange.com/questions/52885/view-pure-gas-usage-cost-gas-if-called-internally-by-another-function
https://ethereum.stackexchange.com/questions/52885/view-pure-gas-usage-cost-gas-if-called-internally-by-another-function
Nov 21, 2020, 1:17 PM
Let's say you have two function A and B (view).
If you call B directly it won't cost u anything,
But if A (non-view) calls B it will cost some extra gas (based on the complexity)
If you call B directly it won't cost u anything,
But if A (non-view) calls B it will cost some extra gas (based on the complexity)
Nov 21, 2020, 1:18 PM
hey tyler can you look at second answer in the link i sent.
The guy says - "They do cost gas if they're part of a transaction that needs to be mined. Gas compensates the network for running your code. It doesn't matter that this particular function doesn't update state; it still takes resources to execute, so it costs gas." . His explanation is the example you just sent , right ?
The guy says - "They do cost gas if they're part of a transaction that needs to be mined. Gas compensates the network for running your code. It doesn't matter that this particular function doesn't update state; it still takes resources to execute, so it costs gas." . His explanation is the example you just sent , right ?
still learning
Nov 21, 2020, 1:21 PM
As I said, only if it's part of the transaction.
Nov 21, 2020, 1:21 PM
cool cool
Nov 21, 2020, 1:22 PM
You can check yourself through Etherscan
Nov 21, 2020, 1:22 PM
i will do that
thanks man
Nov 21, 2020, 1:23 PM