-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deployment of contracts #13
Comments
The "normal" use case in Web3 is to use deployed contracts, not necessarily to deploy new ones. It is easy to access a deployed contract and have type safety with TypeChain. I will now check how other projects use TypeChain. I assume I will have to write a (very thin) wrapper. |
So. I would say that we don't write a thin wrapper, but I am sure not everyone has the same opinion so we can discuss. We provide all the type definitions that a user needs to properly interact with our contracts. if you want to use that to deploy contracts: fine, deploy the contracts the way you deploy contracts. If you want to use that to interact with deployed contracts: fine, interact with the on-chain contracts the way you would interact with on-chain contracts. I am not sure a wrapper would be super beneficial. On the other hand, it always must be kept up-to-date and maintained. Plus potential conflicts with outdated Web3 versions in this repo (like now with mosaicjs and mosaic chains). It's not that hard to deploy a contract using Web3. const organization = new web3.eth.Contract(Organization.abi);
organization.deploy(
Organization.bin,
args...
); What do you think? |
#12 Generates the interacts using typechain package. This interact doesn't have deploy method.
Generated interacts are extended from web3.eth.Contracts class which has deploy method. Theoretically, deploy should be available to the interact.
This ticket is about finding if the
deploy
method can be used to deploy interacts by using web3 types and implementing it.If the
deploy
method can't be used, research how other projects are deploying contracts using type chain. Select and implement the best approach.If nothing works, then write a simple utility to deploy contracts.
References:
https://www.npmjs.com/package/@types/web3
https://www.npmjs.com/package/web3-typescript-typings
The text was updated successfully, but these errors were encountered: