ink! Development
ink! is a Rust-based embedded domain specific language (eDSL) for writing WebAssembly smart contracts specifically for the FRAME Contracts pallet.
ink! is still under development, so the documentation for using it is sparse. However, on this page you will find the best resources to get you started building ink! contracts right away.
Tutorials
The ink! project maintains an up-to-date tutorial teaching all the basics of developing on ink!.
This is the best way to get start learning the language today.
You will learn how to:
- Set up your computer to build and deploy ink! smart contracts.
- Learn the basics of ink! by creating an incrementer contract.
- Learn more advance tricks by developing an ERC20 contract.
Example Contracts
ink! provides a set of example smart contracts that can help you understand how it is similar and different to other smart contract languages.
This includes:
FAQ
Here are some answers to frequently asked questions developers have while building on ink!.
What is the difference between memory and storage?
In ink!, memory
refers to computer memory, while storage
refers to the on-chain storage used by
a contract instance. memory
is temporary and only lasts until the contract execution is done,
while storage
is persistent and lasts over many contract executions. The contract storage
is
built on top of the runtime storage, and access is considered to be slow.
How do I run tests?
When building a smart contract with ink!, you can define a set of tests.
For example, in the minimal flipper contract, you can find a small test at the bottom of the contract.
You should run this test just like you would any other Rust test:
cargo +nightly test
Get Help
Join the growing community of ink! smart contract developers:
- Ask development questions on StackOverflow with
the
ink
tag. - Join the live chat in the Smart Contracts & Parity ink! on Riot.
- Report bugs, make feature requests, and ask technical questions on the ink! GitHub.
Next Steps
Learn More
- Learn more about the design philosophy of ink! in our conceptual documentation.
- Learn more about the Contracts pallet.
Examples
References
- Visit the ink! repository for additional docs and to look at the source.
- Visit the ink! developer homepage
- Visit the reference docs for the ink! metadata.
- Visit the reference docs for the core ink! language.