SimpleICO Route Structure
Routes are defined in the app-routing.module.ts file. Each route resolves to a Module ContainerComponent that structures the dApp in modules.
Contract routes
When you create a new interface for a Solidity smart contract you will consider the create
, deploy
, show
and index
route endpoints.
See creating a new contract type for details about the contractType
param needed in these routes.
contract/:contractType/create
This route includes child components with the name of your contract type that can have HTML forms, styling or other setup for that particular contract type.
To create a new component for this route execute:
ng generate component contract-create/<contract-type> --project=simple-ico
The contract-create/container.component.ts will take care of displaying the corresponding contractType component.
Setup smart contract constructor paramscontract/:contractType/deploy
The contract-deploy namespace will take charge of guiding the end-user through a series of steps, beginning with an estimate of the transaction costs and followed by any steps that you may program in to the SCUI.
To create a new component for this route execute:
ng generate component contract-deploy/<contract-type> --project=simple-ico
contract/:contractAddress/show/:contractType
The contract-show namespace takes charge of displaying the deployed contract details. You may add any HTML components that will make the end-user interact with the contract state or methods.
To create a new component for this route execute:
ng generate component contract-show/<contract-type> --project=simple-ico
public/contract/:contractAddress/show/:contractType
This route inherits from the contract-show component. The difference is that it passes an empty wallet to the *Contract class, so the user may see the contract details without having to unlock a Wallet instance.
To create a new component for this route execute:
ng generate component contract-show-public/<contract-type> --project=simple-ico
contract/:contractType/index
The contract-index namespace lists the SCUIs by type. This component will use the SimpleICOContract (in this case) to list the contracts that have been created with the dApp so far.
To create a new component for this route execute:
ng generate component contract-index/<contract-type> --project=simple-ico
public/contract/:contractType/index
Similar to the contract-show-public. This endpoint will give public access to the contracts list without having to unlock a Wallet instance. After all, the blockchain is public, right?
To create a new component for this route execute:
ng generate component contract-index-public/<contract-type> --project=simple-ico
Auth routes
The SimpleICO web-app does not handle usernames or passwords nor stores any data about the user in any centralized server or SaaS.
However in order to sign ethereum transactions, the user must have an unlocked wallet.
An unlocked wallet means that the user entered a private key or a mnemonic passphrase that unlocks a Web3 wallet instance. This will allow the user to interact with the Ethereum network during the current web-app session. Whenever the user refreshes or closes the tab, the wallet will be reset leaving no traces of the wallet information. (Unless you fell victim of a phishing site, be warned!).
login
The /login route lets the user paste a private key or a mnemonic passphrase from any Ethereum compliant wallet.
A note about security
We strongly suggest that you login with a wallet that has just the necessary ETH to execute the transactions. You will not need more than 1 ETH for most of the transactions executed with the SCUIs
SimpleICO takes no responsibility about the loss of ETH or sensible information.
new-wallet
The /new-wallet route, allows the user to create a new wallet by generating a private key, a mnemonic passphrase and an ETH address.
The user must store this data somewhere safe in order to keep using the same SCUI app wallet.
Last updated