Hot answers tagged

2

When calling associatedToken.transfer(address(this), _ammount) the caller of this transaction is your contract, so it tries to transfer contract's 82 DAI to itself. To transfer DAI you should be the caller of the transaction with transfer() function call. You should upload DAI's code to Remix and use "At address" button and then call transfer() function at ...


1

I though I will comment to @lunr's answer but adding as an answer due to it's length. And if that's true, will that transaction take longer to get confirmed than say a regular transfer transaction? (given they're both sent with the same gas price) The answer is it depends. Let A be a regular transaction and B be the one that consumes gas limit. Suppose ...


1

Does a transaction that requires the entire block gas limit to be executed (currently ~8M) take the entire block by itself? Yes. And if that's true, will that transaction take longer to get confirmed than say a regular transfer transaction? (given they're both sent with the same gas price) Probably. That's because including that tx in a block will be ...


1

Well, you can obviously change this: while (count != 0) { ... count = count.sub(1); } To this: while (count != 0) { ... count -= 1; } Which will reduce a little bit of gas whenever this loop is executed. You can also change every occurrence of div into a simple /. The div function is generally "symbolic", and it is designated just for ...


1

the answer lie in this article: https://link.medium.com/7oxDTDmKpZ tl;dr: they are the same but the order of method_id make func1 more expensive than func2 Update: So i have try to my theory it seem like somehow it is the solidity function name problem. The reverse code: pragma solidity ^0.5.0; contract Test { uint public value; function func2(...


1

...0 gas, 0 ether but plenty of tokens transferred Just to be clear, the transaction required 47,435 gas. (gas is a measure of work done by the EVM - you can't have a 0 gas transaction.) ... but still the person who send this had spent total 0$ in fees, correct? Correct. They just submitted a transaction with gas price set to 0, which is fine. Now I ...


1

the value is replaced with available gas right? As a bit of a simplification, yes. IIRC, I believe the amount of gas forwarded to the callee is actually 63/64ths of the remaining gas in the transaction.


Only top voted, non community-wiki answers of a minimum length are eligible