Comments (7)
Hey, thanks for pointing this out. I think that quote only refers to the Solidity language itself and not to the encoding per se, but I'll try to grab some test encodings from other Ethereum clients to see if they encode strings differently. That should help to find the exact problem.
from web3dart.
I just checked whether the test cases of web3j, notably https://github.com/web3j/web3j/blob/master/abi/src/test/java/org/web3j/abi/TypeEncoderTest.java and https://github.com/web3j/web3j/blob/master/abi/src/test/java/org/web3j/abi/TypeEncoderTest.java for strings and static / dynamic length bytes also work for this library and they produce the expected output...
Can you help me with this by giving an example of a contract definition that returns a string that can't be decoded by this library? That would really be helpful!
from web3dart.
Ropsten, chainid: 3
Address: 0xD73845bba002a3f2a5c2DF835fD67d282afbf4E8
ABI: [ { "constant": true, "inputs": [ { "name": "fileHash", "type": "string" } ], "name": "getOwner", "outputs": [ { "name": "", "type": "string", "value": "" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x4aaf4a12" }, { "constant": true, "inputs": [ { "name": "fileHash", "type": "string" } ], "name": "get", "outputs": [ { "name": "", "type": "uint256", "value": "1542556069" }, { "name": "", "type": "string", "value": "pepito" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0x693ec85e" }, { "constant": true, "inputs": [ { "name": "fileHash", "type": "string" } ], "name": "getTime", "outputs": [ { "name": "", "type": "uint256", "value": "0" } ], "payable": false, "stateMutability": "view", "type": "function", "signature": "0xb359cedd" }, { "constant": false, "inputs": [ { "name": "owner", "type": "string" }, { "name": "fileHash", "type": "string" } ], "name": "set", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function", "signature": "0xe942b516" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "status", "type": "bool" }, { "indexed": false, "name": "timestamp", "type": "uint256" }, { "indexed": false, "name": "owner", "type": "string" }, { "indexed": false, "name": "fileHash", "type": "string" } ], "name": "logFileAddedStatus", "type": "event", "signature": "0x0d3bbc3c02da6ed436712ca1a0f626f1269df703a105f034e4637c7b10fb7ba5" } ]
Source Code: https://gist.github.com/DrasiusMajere/ad37aabcad54f96a45be8faf7c694be8
P.D: soljs, remix, etherscan are not able to create the bytecode yet. I've used solc to compile it.
from web3dart.
Silly question why prepareForPaymentCall, prepareForCall functions need DeployedContract instance if transaction object already has credentials and send and call methods has to pass them web3client. Is it not sufficient with EthereumAddress?
I have too many things to learn, it's huge this cryptoworld
from web3dart.
Thanks for the contract. Can you give me some sample method invocation that fails in web3dart? Any fileHash
I can put into getOwner
should return a string that breaks in web3dart, right?
Silly question why prepareForPaymentCall, prepareForCall functions need DeployedContract instance if transaction object already has credentials and send and call methods has to pass them web3client. Is it not sufficient with EthereumAddress?
Not a silly question at all! You're right, the EthereumAddress
would suffice. My idea was that users should only have to specify that whole thing once. Also, I planned that this library might do some code-generation based on contract ABIs to convert them into dart classes. Then, we could just have something like MyContract(credentials, client, address).getOwner(fileHash)
and call all other functions on MyContract
without having to specify everything for each function call.
However, I didn't have the time to implement this yet so right now everything is pretty low-level and this is indeed irrelevant information passed to the contract object.
I have too many things to learn, it's huge this cryptoworld
Yeah, I feel like that as well sometimes, I also don't have any experience with cryptocurrencies except for this library. Put poking around with some code helps. In fact, I mainly started this library to learn about some low-level basics about Ethereum transactions 😃
from web3dart.
Sorry I forgot that ,Hash: "123456789"
for instance....if you use ethereum wallet is easy to watch any contract and use its functions....
Use the get
method instead of getOwner or getTime beuause these ones were just created to know which return value was provoking the failure(error).
If you call to getOwner it's just receive an empty string.
from web3dart.
This should now be fixed in version 0.4.5
on pub, sorry for taking this long. I didn't catch it earlier because all the types are decoding properly, it's just the function decoder that messes things up. Many thanks to @xiaoch05 for pointing out the error. Let me know if it still doesn't work.
from web3dart.
Related Issues (20)
- NFT dapp HOT 1
- How to set a timeout for Web3Client? HOT 1
- intToBytes mistake
- How to decodeParameters
- web3dart
- Ignore non_constant_identifier_names, camel_case_types in generated (.g.dart) files HOT 5
- Test Net HOT 2
- Support ethers.utils functionality HOT 1
- Bug: Zero address returned from contract call causes exception HOT 20
- web3dart: ^2.3.3
- private Api for centralized blockchain HOT 3
- How can i call smart contract functions through web3dart without private key in flutter HOT 2
- getBlockInformation() - Throws Error HOT 1
- Transaction Lists HOT 2
- How a new user can create an account without private key?
- Support for BEP20 Transfer?
- Value not in Range
- On Ganache V 7.0.0 I am receiving an rpc error "Unhandled Exception: RPCError: got code -32700 with msg "Invalid signature v value"." HOT 1
- Getting transactions with eth_getBlockByNumber
- Doesn't work after building project but works fine in debug
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 web3dart.