examples.rst 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Solang Solidity Examples
  2. ========================
  3. Here are two examples of Solidity contracts.
  4. General examples
  5. ----------------
  6. Flipper
  7. _______
  8. This is the `ink! flipper example <https://github.com/paritytech/ink/blob/v3.3.0/examples/flipper/lib.rs>`_
  9. written in Solidity:
  10. .. include:: ../examples/flipper.sol
  11. :code: solidity
  12. Example
  13. _______
  14. A few simple arithmetic functions.
  15. .. include:: ../examples/example.sol
  16. :code: solidity
  17. Solana examples
  18. ---------------
  19. NFT example
  20. ___________
  21. There is an example on Solana's integration tests for a Solidity contract that manages an NFT. The contract is supposed
  22. to be the NFT itself. It can mint itself and transfer ownership. It also stores on chain information about itself, such as its URI.
  23. Please, check `simple_collectible.sol <https://github.com/hyperledger/solang/blob/main/integration/solana/simple_collectible.sol>`_
  24. for the Solidity contract and `simple_collectible.spec.ts <https://github.com/hyperledger/solang/blob/main/integration/solana/simple_collectible.spec.ts>`_
  25. for the Typescript code that interacts with Solidity.