English | 日本語
Tokens and DEX contracts available in the ibet DeFi network
- The ibet-SmartContract project is a project to build an open financial system on the ibet-Network blockchain.
- The project aims to provide token standards, decentralized exchanges, and other utility functions that can be used on the ibet-Network.
- Python3
- Version 3.11
- Node.js
- Version 20
- Solidity
- We are using Solidity to implement our smart contracts.
- Currently, we are using v0.8.23.
- eth-brownie
- We are using the eth-brownie framework for developing and testing our contracts.
- GoQuorum
- We support the official GoQuorum node of ibet-Network.
- We use hardhat network for local development and unit testing, and we use the latest version.
- OpenZeppelin
- Our project is partly dependent on OpenZeppelin.
- We use openzeppelin-contracts v4.9.
IbetStandardTokenInterface
: Standard token interface for ibet-SmartContractIbetExchangeInterface
: Standard interface for exchange contracts in ibet-SmartContract.
access
: Determines which users can perform each action in the system.exchange
: Implementations of the various exchanges.ledger
: A data storage system that manages the data required as additional information in the ledger.payment
: A set of functions required to build an off-chain payment system.token
: Implementation of the various token formats: ERC20, ERC721, Bonds, Shares, etc.utils
: A set of other utility functions.
Install eth-brownie as a python package.
$ make install
Install openzeppelin-contracts.
$ brownie pm install OpenZeppelin/[email protected]
Install hardhat as a Node.js package.
$ npm install
Use eth-brownie to compile contracts.
$ brownie compile
You can switch the EOA used for deploying the contract by setting an environment variable.
This is the case when you store and use your private key in GoQuorum(Geth).
ETH_ACCOUNT_PASSWORD
- The passphrase you have set for the Geth keystore file.
This is the case when you use a local keystore file.
ETH_KEYSTORE_PATH
- Path of the directory where the keystore is stored.ETH_ACCOUNT_PASSWORD
- The passphrase you have set for the keystore file.
This is the case when you use a raw private key.
ETH_PRIVATE_KEY
- Raw private keyETH_ACCOUNT_PASSWORD
- Passphrase for encrypting the private key.
This is the case of storing and using a private key in keystore file format in AWS Secrets Manager.
AWS_REGION_NAME
- AWS Region (default: ap-northeast-1)AWS_SECRETS_ID
- Secret's ARNETH_ACCOUNT_PASSWORD
- The passphrase you have set for the keystore file.
To deploy, execute the following command.
$ ./scripts/deploy_shared_contract.sh {--payment_gateway 0xabcd...} {contract_name}
You can deploy the following contract as contract_name
.
- E2EMessaging
- TokenList
- PersonalInfo
- PaymentGateway
- IbetExchange (* need --payment_gateway option)
- IbetEscrow
- IbetSecurityTokenEscrow
- FreezeLog
All other contracts are not supported for deployment by script. You will need to deploy them in a different way.
Network settings are defined in the hardhat.config.js
file.
- chainId: 2017
- gasPrice: 0
- blockGasLimit: 800000000
- hardfork: "berlin"
When developing in a local environment, start and use the hardhat-network
container defined in docker-compose.yml
.
By default, the RPC service starts on port 8545.
Importing network settings to Brownie.
$ brownie networks import data/networks.yml
You can run the tests with:
$ brownie test
Alternatively, you can use pytest and run it as follows.
$ pytest tests/
This repository is version controlled using the following flow.
ibet-SmartContract is licensed under the Apache License, Version 2.0.
We are committed to open-sourcing our work to support your use cases. We want to know how you use this library and what problems it helps you to solve. We have two communication channels for you to contact us:
-
A public discussion group where we will also share our preliminary roadmap, updates, events, and more.
-
A private email alias at [email protected] where you can reach out to us directly about your use cases and what more we can do to help and improve the library.
Please refrain from sending any sensitive or confidential information. If you wish to delete a message you've previously sent, please contact us.