-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
79 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,104 @@ | ||
## Foundry | ||
|
||
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** | ||
# Saga Treasury | ||
|
||
Saga Treasury is a smart contract project that manages treasury functions and token operations using the ERC-1400 standard. This project includes various deployment scripts, token contracts, and the main treasury contract. | ||
|
||
## Project Structure | ||
|
||
```plaintext | ||
. | ||
├── foundry.toml # Foundry configuration file | ||
├── lib | ||
│ ├── forge-std # Standard Forge library for Solidity tests | ||
│ └── openzeppelin-contracts # OpenZeppelin contracts for ERC standards | ||
├── Makefile # Makefile for automating tasks | ||
├── README.md # Project documentation | ||
├── script # Deployment and helper scripts | ||
│ ├── HelperConfig.s.sol # Configuration script | ||
│ ├── Tokens # Token-related scripts | ||
│ │ ├── FYRE # FYRE Token deployment scripts | ||
│ │ └── MANA # MANA Token deployment scripts | ||
│ └── Treasury # Treasury deployment scripts | ||
│ ├── DeployOwnershipToTreasury.s.sol | ||
│ └── DeployTreasury.s.sol | ||
└── src # Core contract sources | ||
├── Tokens # Token contracts | ||
│ ├── ERC1400 # ERC1400 standard contracts | ||
│ ├── FYREToken.sol # FYRE token contract | ||
│ ├── MANA.sol # MANA token contract | ||
│ └── ManaToken.sol # Additional MANA token implementation | ||
└── Treasury # Treasury contract | ||
└── Treasury.sol # Core treasury contract | ||
``` | ||
|
||
Foundry consists of: | ||
## Getting Started | ||
|
||
- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). | ||
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. | ||
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. | ||
- **Chisel**: Fast, utilitarian, and verbose solidity REPL. | ||
### Prerequisites | ||
|
||
## Documentation | ||
Ensure you have the following tools installed: | ||
|
||
https://book.getfoundry.sh/ | ||
- [Foundry](https://github.com/gakonst/foundry) - for smart contract development and testing | ||
- [Node.js](https://nodejs.org/) - for scripting, if needed for deployment | ||
- [OpenZeppelin Contracts](https://openzeppelin.com/contracts/) - ERC standard libraries | ||
|
||
## Usage | ||
### Installation | ||
|
||
### Build | ||
1. Clone the repository: | ||
|
||
```bash | ||
git clone https://github.com/yourusername/saga-treasury.git | ||
cd saga-treasury | ||
``` | ||
|
||
```shell | ||
$ forge build | ||
``` | ||
2. Install dependencies (e.g., OpenZeppelin contracts) if not already included. | ||
|
||
### Compiling Contracts | ||
|
||
### Test | ||
Use Foundry to compile the contracts: | ||
|
||
```shell | ||
$ forge test | ||
```bash | ||
forge build | ||
``` | ||
|
||
### Format | ||
### Running Tests | ||
|
||
```shell | ||
$ forge fmt | ||
Run tests using Foundry: | ||
|
||
```bash | ||
forge test | ||
``` | ||
|
||
### Gas Snapshots | ||
### Deployment | ||
|
||
```shell | ||
$ forge snapshot | ||
``` | ||
Deployment scripts are located in the `script/` directory. Each script is a Solidity script designed to be run with Foundry or custom deployment tools. | ||
|
||
### Anvil | ||
Example: Deploy the Treasury contract: | ||
|
||
```shell | ||
$ anvil | ||
```bash | ||
forge script script/Treasury/DeployTreasury.s.sol --rpc-url <RPC_URL> --private-key <PRIVATE_KEY> --broadcast | ||
``` | ||
|
||
### Deploy | ||
Replace `<RPC_URL>` and `<PRIVATE_KEY>` with your network RPC URL and private key, respectively. | ||
|
||
```shell | ||
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key> | ||
``` | ||
## Contracts Overview | ||
|
||
### Cast | ||
### Treasury.sol | ||
|
||
```shell | ||
$ cast <subcommand> | ||
``` | ||
The `Treasury.sol` contract is the central contract for managing treasury functions. It holds and manages tokens and includes functions for ownership and fund distribution. | ||
|
||
### Help | ||
### Tokens | ||
|
||
```shell | ||
$ forge --help | ||
$ anvil --help | ||
$ cast --help | ||
``` | ||
- **FYREToken.sol**: Contract implementing the FYRE token. | ||
- **MANA.sol**: Contract for MANA token. | ||
- **ManaToken.sol**: Alternative implementation of the MANA token. | ||
- **ERC1400**: Contains implementations of ERC-1400 standard token functions. | ||
|
||
## Scripts Overview | ||
|
||
- **HelperConfig.s.sol**: Configuration script for setting up initial values. | ||
- **DeployOwnershipToTreasury.s.sol**: Script to transfer ownership to the Treasury. | ||
- **DeployTreasury.s.sol**: Script to deploy the Treasury contract. | ||
|
||
## License | ||
|
||
This project is licensed under the terms of the MIT license. See [LICENSE](./LICENSE.txt) for more details. |