https://github.com/mradkov/aeternity-token-sale-example
Aeternity Token Sale Example
https://github.com/mradkov/aeternity-token-sale-example
aeternity aex9 fungible smartcontracts sophia token tokensale
Last synced: 4 months ago
JSON representation
Aeternity Token Sale Example
- Host: GitHub
- URL: https://github.com/mradkov/aeternity-token-sale-example
- Owner: mradkov
- License: isc
- Created: 2019-11-20T08:29:58.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-07T14:15:19.000Z (over 3 years ago)
- Last Synced: 2025-05-27T20:11:34.829Z (5 months ago)
- Topics: aeternity, aex9, fungible, smartcontracts, sophia, token, tokensale
- Language: JavaScript
- Homepage: https://tokensale.aepps.tech
- Size: 2.83 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aeternity Token Sale Example
This repository provides an example of a contribution campaign/token sale conducted on top of aeternity blockchain.
The tokens examples are following the [AEX-9](https://github.com/aeternity/AEXs/blob/master/AEXS/aex-9.md) standard for fungible tokens on aeternity.
# Documentation
## Contracts
### Token Sale contract
The `token-sale.aes` contract is implementing the interface of an aex9 fungible token. Since we only need to call `entrypoint mint()` in order to issue new tokens for people that contributed to the campaign we are only using this interface:
```sophia
contract FungibleTokenFullInterface =
entrypoint mint : (address, int) => unit
```The contract also has few more functions - `contribute`, `set_token` and `withdraw` which respectively do the following:
`set_token` - this should be called in order to specify the address of the token contract which would be issued during the contribution campaign.
`contribute` - allows people to send value in AE tokens and calls the `mint` function on the specified token contract in the state of the contract, issuing new tokens amount according to the price ratio speicified in the token sale.
`withdraw` - allows the `owner` of the `token-sale` contract to withdraw the collected amount of AE.
### Fungible token contract
This is a slightly modified version of the `mintable` aex9 contract. The difference is we have specified a new role - `minter` who is allowed to issue new tokens, increasing the `total_supply`.
In this case the `minter` is our `token-sale` contract.