Closed Naltox closed 1 year ago
After a detailed study of the description, I am ready to declare that I can take this task to work. A little later, after I have received confirmation, I will be able to provide links to the repositories where development will take place, here.
Starttime: 5 Jul 2022
Deadline: 31 Jul 2022
@Hiyorimi @Naltox Please confirm.
LGTM. I doubt that somebody else will pick up on current footstep.
Any activity here?
Notify me if this task moves to another blockchain (e.g. @everscale-org, or maybe Ethereum/Polygon e.t.c.) 😀
Hey guys, sharing with you some more detailed thoughts on this task:
init - initiates project creation process
clean - deletes temp. files (if some)
test - runs all tests
deploy - helps to deploy contract(s) to mainnet/testnet
run - runs user-defined scripts
I think we should came up with some abstractions for working with smart contract (both locally & remote).
First of all we should came up with smart contract descriptor (code cell + data cell) & easy way to build it, it’s useful both for local testing and deployment process
Basically we need something like this:
type SmartContractDescriptor = {
code: Cell
data: Cell
}
type SmartContractBuilder<Config> = {
buildCode(config: Config): Cell
buildData(config: Config): Cell
}
One may came up with better abstractions, but basic idea is the same.
In this case SmartContractBuilder could be used for some standard way of deploying contracts and for building local copy of contract for testing.
Also we might (?) came up with some JSON format for storing SmartContractDescriptor on disk after compilation.
Contract instance
Besides that i think we need some representation of smart contract itself (some class i guess) which could be initialized both from network (by downloading code & data cells), from some config locally of by providing contract descriptor. Also this abstraction should have methods for invoking get methods on contract & sending messages (both locally for testing and remote for deployed ones).
I think this classes should be written by smart-contract developer, but we can provide some templates for this.
As an example for inspiration u suggest to check this repo:
https://github.com/getgems-io/nft-contracts
It solves mostly local running, but i think it illustrates the idea.
Some other option is to came up with some standard way for building messages for contract & have two standard functions sendInternalMessage & sendExternal message for local testing.
In this way developer could reuse functions for building messages.
When creating new project tool should create directory with fully initialized Node.js TypeScript project including:
Tool should provide some basic templates for test written on mocha.
In my opinion tests should use some instance of Contact instance (described above) and operate with it by calling get methods or emulating sending messages.
Also we should provide some helper functions for writing tests, thinks like:
Deploying process should be pretty simple, so i propose to use mobile wallets for this.
Both TonKeeper & TonHub support deploying smart-contracts using deep-links.
I think we can generate those deep-links and show them in console (probably we should somehow short them since code cell & data cells are included in those links).
Also it would be helpful to watch if contract was deployed and notify in console.
Ideally developers should be able to reuse all code & abstractions from tests to work with real-world deployed smart contract. In this way after local development and testing project developer should vale like 80% of code for interacting with deployed contract already and should only write some scripts for sending messages to deployed contract.
Developer should be able to easily write scripts that build some messages for contract, send them to the network and check for results (maybe we can provide some primitives for doing that through QR codes in console, just like in deployment scripts).
We need this tool to be fully covered with docs and examples, so developers can jump straight to writing some code & seeing results.
Also we need some e2e communication with developer community at the release time (answering to issues, working with PR’s, etc).
Developers should be able to:
Core goal is to came up with some standard universal way for full contract development process including local testing, deployment and interacting with already deployed contracts with as much reuse of code as we can.
@Naltox can you confirm?
Looks like no one wants to take up this footstep. We with @Gusarich can try to implement it. @Hiyorimi Can you assign us to this issue?
@Naltox can you please confirm?
We are actually working on this one at TonTech and have some progress already, @Hiyorimi maybe you can confirm us? 😁
@Naltox Sure! Assigned you to this issue.
@Gusarich @Naltox Are you guys working on this?
Since blueprint solves this problem, this footstep has lost its relevance.
Summary
CLI tool for fast and easy setup for TON smart-contract developers. The best analogy is the Hardhat from the Ethereum world.
Context
At this stage there is no such tool for setting up a new smart contract project with easy deployment, testing and debugging using JS/TS, which are standard in crypto world. We have toncli which is a good product, but since its core philosophy is to use Fift & FunC for deploying scripts, testing, etc - it's not that easy for new developers to quickly jump in.
Goals
Deliverables
Definition of Done
Developers are able to setup an environment for developing smart contracts in TON and start experimenting in less than 1 hour.
Reward