Comments (8)
Hello.
Does multipleTransfer(tuple(address,tuple(uint256,address)[]))
works?
from ethgo.
No it sadly does not. This feature is not necessarily needed as I see it too complex and the best way to create a new Method should be through the usage of the complete ABI of that method and not only the method signature.
But if it is possible to create a Method
struct with only the method signature deterministically, that would be really powerful and useful (for example, you won't need the ABI to be able to communicate with a contract but only the method signature would be enough)
from ethgo.
I understand, something like this is available https://github.com/umbracle/go-web3/blob/master/abi/abi_test.go#L53 but it will not work if the input is a struct (I think). In ethers.js it does work with tuples. I can work to fix this over the weekend since I have to do a couple more changes on abi .json decoding.
from ethgo.
Thanks! Just be aware that this multipleTransfer(tuple(address,tuple(uint256,address)[]))
is not a valid method signature. The tuple
keyword should not be part of the signature. If you encounter a parenthesis "inside" of the method signature (first parenthesis), I think you can assume it's a tuple.
from ethgo.
Ok, but I do not think there any difference with what ethers.js decodes here right? I will just try to implement those test cases.
from ethgo.
I have a fix in #134. It turns out it was already supported but the regexp expression to get the function parameters was not correct to counter for extra '('. I will merge this after your #131.
from ethgo.
Please test the branch #134 with the changes, note that you need to use function multipleTransfer(tuple(address,tuple(uint256,address)[]))
with the function
prefix and tuple()
.
from ethgo.
Sadly that is not useful for our use case because using tuple
in the method signature is not valid. One of the use case of this method is to be able to pass a method signature and get a Method
back so arguments can be encoded without needing the whole ABI.
You should be able to do something like:
abi := web3.NewABI(myABI)
method := web3.ParseMethodSignature(abi.Methods[0].Sig())
txData := web3.Encode(method.Inputs, args)
where abi.Methods[0].Sig()
is the method signature multipleTransfer((address,(uint256,address)[]))
Would that work ?
from ethgo.
Related Issues (20)
- how to ? go/src/github.com/umbracle/ethgo/structs_marshal_rlp.go:21:14: undefined: fastrlp.MarshalRLP HOT 2
- wallet.NewWalletFromPrivKey will get a wrong wallet address HOT 3
- The result of GetTransactionByHash can not get correct gas ? transanction type 2 HOT 2
- How to get pending transaction? HOT 2
- go mod tidy error HOT 8
- Transaction Params (nonce, gasprice, etc) HOT 10
- contract.go call function, Should Block:block? HOT 1
- How to send EIP1559 transction? HOT 1
- Testutil server with premined addresses HOT 1
- Wrong wallet from private key HOT 1
- NewTestServer unreachable rpc address HOT 3
- old transaction receipt fetching fails
- Why are primitive types not copied? For example gas\gasprice\nonce HOT 4
- abi struct tags only work in lower case HOT 2
- Need a way to detect connection errors of websocket HOT 2
- encode nested tuple error HOT 1
- Incorrect implementation of RecoverSender HOT 1
- Not all ethereum methods were implemented
- set apiKey for etherscan client
- My account stopped mining HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethgo.