This template allows a user to (a) utilise a smart contract template that can be deployed on Ethereum's blockchain, (b) connect the smart contract to a local repository, (c) interact with the smart contract through a frontend, and (d) customize frontend whilst still being connected to the smart contract.
Secret.sol
: Smart contract written in Solidity with two simple functionsapp.js
: Interacting with the smart contract on Ethereum's blockchain - change two variables to add your own contract once you have deployed it.app.js
and index.html
: Intuitive and simple interaction between the html (frontend) and JavaScript (using web3.js to interact with the smart contract)index.css
: Simple CSS to customize the websitenpm install
npm run dev
This repository is connected to a deployed contract on Ropsten Test Network. The smart contract in this repository [Secret.sol] is simply included as a smart contract template. To add your own contract:
ABI
and var contractAddress
Our template contract is written in Solidity and has two main funcitons:
setSecretWord
allows the user to set "a secret word"getSecretWord
: retrieving the latest "secret word"The file is included in this repo for reference, but not used for other purposes. The exact same smart contract is deployed on Ropsten - hence, changes in this file will not affect the template.