Flip the contract function calls
See original GitHub issue- Version: 4
What was wrong?
The order of calls (contract.call().doSomething()
) could be more intuitive.
How can it be fixed?
Basic Approach
web3.js seems to have a solid solution: contract.functions.method().call()
Plus:
..method().transact()
..method().estimateGas()
- etc
This API can coexist alongside the old way of calling contract methods.
API Naming
functions
is a little long, here are some other options:
contract.api.doSomething().call()
contract.public.doSomething().call()
contract.build.doSomething().call()
contract.make.doSomething().call()
contract.prep.doSomething().call()
contract.useabi.doSomething().call()
contract.go.doSomething().call()
contract.methods.doSomething().call()
Added
Also, think about how the name will sound when used with other execution options, like transact
, estimateGas
, and buildTransaction
Requirements
- add new API
- document new API in
docs/
- add deprecation warning to old call/transact/etc methods
- Bonus: Update
ConciseContract
to use the new Contract API under the hood (with no change to the external API)
Issue Analytics
- State:
- Created 6 years ago
- Comments:37 (16 by maintainers)
Top Results From Across the Web
How to call a payable function with no parameters?
For example, in web3.js to call the function you would simply do this and the transaction would go through: await contract.methods.
Read more >Flipping a Coin in Ethereum
In this post, I'll describe how two parties can bet on a coin flip in an Ethereum smart contract by using a simple...
Read more >Calling Parent Functions | Solidity 0.8 - YouTube
Two ways to call parent functions #Solidity #SmartContract #Ethereum #スマートコントラクトRemixhttps://remix.ethereum.
Read more >How to use low level call for contract function ... - Kush's blog
delegatecall is used to call a function of contract B from contract A with contract A's storage, balance and address supplied to the...
Read more >Ethernaut Lvl 3 Coin Flip Walkthrough: how to abuse ...
3. Call your hackFlip() function 10 times. The original contract's consecutiveWins counter should steadily increase, as you are only making ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is anyone working on this? If not, I would like to give it a try.
This issue now has a funding of 0.335 ETH (110.39 USDT) attached to it. To view or claim this funding, click here.