Reference Contracts
This page is dedicated to community tutorials and code repositories that provide helpful references for writing Secret Network contracts as well as building full-stack Secret Networks dApps.
Learn to build on Secret Network with Secret University and dive deep into the code with Secret University Boxes, which are pre-built, preconfigured dApp templates built on Secret Network. Each Secret Box runs in its own sandbox developer environment and comes preconfigured with a simple UI kit.
Use this link to see a sample voting contract and a line-by-line description of everything you need to know.
For an even more advanced version of this stunning Secret Sealed Bid Auction app, you can refer to its enhanced Secret Auction Factory put in production.
- Connecting to Secret Network
- Creating account using SecretJS
- Query Secret Network
- Submitting transactions
- Using contracts
- Wallets
- SNIP-20 tokens
- Consuming websocket contract events
If you are interested to know how to programmatically use the bridge, you can look at the manual swap section of the Ethereum Bridge doc.
To master the SNIP-20 contract specifications, you can refer to these two key parts:
To master the SNIP-721 contract specifications for Non-Fungible Tokens (NFT), you can refer to these two key parts:
Here are some examples of additional Secret Contracts for reference:
- Millionaire's Problem - This is part of the Getting Started Guide. It is meant as an easy to understand first contract example that solves the Millionaire's Problem.
- Template with Viewing Keys and Permits - Includes messages for frequently used permissioned functionality.
- Factory Contract Template - Demonstrates how to use a parent contract to create offspring contracts.
- Cross-Chain Contracts Demo - Example of a contract that can be uploaded to both secret and non-secret cosmwasm chains.
- Secret Contract Verifier - Verifies that an on-chain contract is indeed running a specific code. Frontend.
- Funds Forwarding - A smart contract that receives tokens and distributes them to multiple addresses. Frontend.
- NFT Authorization - Get authorized to web3 places by proving you are the owner of an NFT. Frontend.
Last modified 1mo ago