Comments (5)
Hey Nick!
I will create an issue for new
... That has been on the back-burner, but I should certainly get that done sooner than later, and get an issue to track it.
Sounds like you are describing the Interface
object, which already exists... It just isn't documented. I think it is currently accessible by the private variable SimpleStore._interface
... It's private for now because I haven't fully finalized the API for accessing the various parts (the parser, formatter, et cetera), but I have now done enough with it, I should be able to finalize the return object, and publish it. And I can make a simple wrapper for Interface
that works with any provider (I think it may already exist, just not exposed).
I will re-think through how provider, wallet and interface objects work together, because you are right, they are 3 separate things that should not entrench the use of the others.
Yeah, I should probably split out the various components as separate NPM projects, but would probably still keep them as one repo, what would you think of that?
The slew of unit tests (I think 30k-ish) for the encoder/decoder are designed strictly against it, so the rest of the wallet doesn't impact it. Also for the iOS implementation I've made all the test cases deterministic, so I will port that back to the JavaScript as well. It will make it easier for ethereumjs to pull them in too.
I was actually thinking of making the unit tests an independent NPM package too, so maybe having multiple NPM packages inside one repo will make that easier to maintain too.
I will get these changes made over the next few days.
Thanks! And please, more/all feedback is welcome. :)
from ethers.js.
Oh, actually, I'd like your feedback on one other issue... Functions can be overloaded by their signature. Currently, I drop all methods with the same method name after the first in the ABI.
contract Ugh {
string _hello;
function foo(uint64 bar) {
_hello = "world";
}
function foo(int64 bar) {
_hello = "WORLD";
}
}
What should contract.setFoo(5)
do? I'm thinking that it would create contract.setFooUint64
and contract.setFooInt64
and contract.setFoo
would just point to the first in the ABI (uint64 in this case). So, sane people without signature overloading have a meaningful, working system, but insane people still have options. Or add an executeExplicit.
that has everything spelled out (for the insane).
from ethers.js.
I think you shouldn't mess with anything. If there are two foo
methods, that's already an extreme edge case. Just use and instantiate the first foo
method. The other is ignored. Don't try and support the world and all of its possibilities.. it will crush you.
from ethers.js.
In my opinion it's not an edge case to have similarly named methods with different types. That's what overloading is for. My suggestion is don't make assumptions about executing the first method encountered, this may differ from what the EVM does. There is an EIP for it somewhere about typechecking and selecting an appropriate method. If an ABI is ordered differently from the EVM's choice a potentially different method will be run (even successfully if the type can be cast).
from ethers.js.
Closing this. The new 2.0 API has a way to create the deployment transaction.
from ethers.js.
Related Issues (20)
- tx.wait() Does not throw an error, continuously loops with error messages. HOT 1
- Module '"ethers"' has no exported member 'EventFragment'.ts(2305)
- hexlify v6 HOT 1
- Providers could do better to handle errors from the Infura and Alchemy API.
- Can not catch some Exception.
- Import error HOT 2
- Different HD wallet address in ethers v6 HOT 4
- How get a mnemonic from connected wallet? HOT 4
- Computing L1 + L2 fees on Base and Manta HOT 4
- JsonRpcProvider: `pollingInterval` option overriden by constructor HOT 1
- WebSocket re-connect HOT 1
- Await on Transaction Submission Waits for Confirmation HOT 10
- Missing r argument after submit transaction in metamask HOT 2
- deployTransaction property is undefined after contract deployment HOT 1
- estimateGas does not support eip-4844. HOT 2
- Tuple return values from contract calls cannot be used as parameters in subsequent calls. HOT 1
- ProviderError: the method has been deprecated: eth_accounts
- mnemonic.computeSeed is not a function (hdwallet.js:318:48) HOT 3
- Error: invalid value for value.data HOT 1
- Unsigned ethers v6 type 2 transaction
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 ethers.js.