generated from foundry-rs/forge-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from PufferFinance/feature/add-coral-getter
Coral getter, readme update
- Loading branch information
Showing
18 changed files
with
369 additions
and
150 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
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,39 +1,25 @@ | ||
# <h1 align="center"> Forge Template </h1> | ||
|
||
**Template repository for getting started quickly with Foundry projects** | ||
|
||
![Github Actions](https://github.com/foundry-rs/forge-template/workflows/CI/badge.svg) | ||
|
||
## Getting Started | ||
|
||
Click "Use this template" on [GitHub](https://github.com/foundry-rs/forge-template) to create a new repository with this repo as the initial state. | ||
|
||
Or, if your repo already exists, run: | ||
```sh | ||
forge init | ||
forge build | ||
forge test | ||
# <h1 align="center"> Puffer Protocol </h1> | ||
[![Github Actions][gha-badge]][gha] [![Website][Website-badge]][Website] [![Docs][docs-badge]][docs] | ||
[![Discord][discord-badge]][discord] [![X][X-badge]][X] [![Foundry][foundry-badge]][foundry] | ||
|
||
[Website-badge]: https://img.shields.io/badge/WEBSITE-8A2BE2 | ||
[Website]: https://www.puffer.fi | ||
[X-badge]: https://img.shields.io/twitter/follow/puffer_finance | ||
[X]: https://twitter.com/puffer_finance | ||
[discord]: https://discord.gg/pufferfi | ||
[docs-badge]: https://img.shields.io/badge/DOCS-8A2BE2 | ||
[docs]: https://docs.puffer.fi/ | ||
[discord-badge]: https://dcbadge.vercel.app/api/server/pufferfi?style=flat | ||
[gha]: https://github.com/PufferFinance/PufferPool/actions | ||
[gha-badge]: https://github.com/PufferFinance/PufferPool/actions/workflows/ci.yml/badge.svg | ||
[foundry]: https://getfoundry.sh | ||
[foundry-badge]: https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg | ||
|
||
![PUFFERS](image.png) | ||
|
||
# Tests | ||
|
||
Installing dependencies and running tests can be executed running: | ||
``` | ||
|
||
## Writing your first test | ||
|
||
All you need is to `import forge-std/Test.sol` and then inherit it from your test contract. Forge-std's Test contract comes with a pre-instatiated [cheatcodes environment](https://book.getfoundry.sh/cheatcodes/), the `vm`. It also has support for [ds-test](https://book.getfoundry.sh/reference/ds-test.html)-style logs and assertions. Finally, it supports Hardhat's [console.log](https://github.com/brockelmore/forge-std/blob/master/src/console.sol). The logging functionalities require `-vvvv`. | ||
|
||
```solidity | ||
pragma solidity 0.8.10; | ||
import "forge-std/Test.sol"; | ||
contract ContractTest is Test { | ||
function testExample() public { | ||
vm.roll(100); | ||
console.log(1); | ||
emit log("hi"); | ||
assertTrue(true); | ||
} | ||
} | ||
``` | ||
|
||
## Development | ||
|
||
This project uses [Foundry](https://getfoundry.sh). See the [book](https://book.getfoundry.sh/getting-started/installation.html) for instructions on how to install and use Foundry. | ||
forge test -vvv --match-path './test/unit/*' | ||
``` |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# PK is for anvil #1 account and he is the deployer | ||
export PK=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 | ||
export RPC_URL=http://localhost:8545 | ||
|
||
forge script script/1_DeployGuardians.s.sol:DeployGuardians --rpc-url=$RPC_URL --sig 'run(address[] calldata, uint256, bytes calldata)' "[0xDDDeAfB492752FC64220ddB3E7C9f1d5CcCdFdF0]" 1 "" --broadcast | ||
|
||
forge script script/SetGuardianEnclaveMeasurements.s.sol:SetEnclaveMeasurements --rpc-url=$RPC_URL --broadcast --sig "run(bytes32,bytes32)" -vvvv 0x2f1488bd64b2c85fc3fe4fa535a89cfa5282ae960e902664ff5390909333e78c 0x83d719e77deaca1470f6baf62a4d774303c899db69020f9c70ee1dfc08c7ce9e | ||
|
||
forge script script/AddLeafX509.s.sol:AddLeaftX509 --rpc-url=$RPC_URL --broadcast --sig "run(bytes)" -vvvv 0x308204a130820309a003020102020900d107765d32a3b096300d06092a864886f70d01010b0500307e310b3009060355040613025553310b300906035504080c0243413114301206035504070c0b53616e746120436c617261311a3018060355040a0c11496e74656c20436f72706f726174696f6e3130302e06035504030c27496e74656c20534758204174746573746174696f6e205265706f7274205369676e696e67204341301e170d3136313132323039333635385a170d3236313132303039333635385a307b310b3009060355040613025553310b300906035504080c0243413114301206035504070c0b53616e746120436c617261311a3018060355040a0c11496e74656c20436f72706f726174696f6e312d302b06035504030c24496e74656c20534758204174746573746174696f6e205265706f7274205369676e696e6730820122300d06092a864886f70d01010105000382010f003082010a0282010100a97a2de0e66ea6147c9ee745ac0162686c7192099afc4b3f040fad6de093511d74e802f510d716038157dcaf84f4104bd3fed7e6b8f99c8817fd1ff5b9b864296c3d81fa8f1b729e02d21d72ffee4ced725efe74bea68fbc4d4244286fcdd4bf64406a439a15bcb4cf67754489c423972b4a80df5c2e7c5bc2dbaf2d42bb7b244f7c95bf92c75d3b33fc5410678a89589d1083da3acc459f2704cd99598c275e7c1878e00757e5bdb4e840226c11c0a17ff79c80b15c1ddb5af21cc2417061fbd2a2da819ed3b72b7efaa3bfebe2805c9b8ac19aa346512d484cfc81941e15f55881cc127e8f7aa12300cd5afb5742fa1d20cb467a5beb1c666cf76a368978b50203010001a381a43081a1301f0603551d2304183016801478437b76a67ebcd0af7e4237eb357c3b8701513c300e0603551d0f0101ff0404030206c0300c0603551d130101ff0402300030600603551d1f045930573055a053a051864f687474703a2f2f7472757374656473657276696365732e696e74656c2e636f6d2f636f6e74656e742f43524c2f5347582f4174746573746174696f6e5265706f72745369676e696e6743412e63726c300d06092a864886f70d01010b050003820181006708b61b5c2bd215473e2b46af99284fbb939d3f3b152c996f1a6af3b329bd220b1d3b610f6bce2e6753bded304db21912f385256216cfcba456bd96940be892f5690c260d1ef84f1606040222e5fe08e5326808212a447cfdd64a46e94bf29f6b4b9a721d25b3c4e2f62f58baed5d77c505248f0f801f9fbfb7fd752080095cee80938b339f6dbb4e165600e20e4a718812d49d9901e310a9b51d66c79909c6996599fae6d76a79ef145d9943bf1d3e35d3b42d1fb9a45cbe8ee334c166eee7d32fcdc9935db8ec8bb1d8eb3779dd8ab92b6e387f0147450f1e381d08581fb83df33b15e000a59be57ea94a3a52dc64bdaec959b3464c91e725bbdaea3d99e857e380a23c9d9fb1ef58e9e42d71f12130f9261d7234d6c37e2b03dba40dfdfb13ac4ad8e13fd3756356b6b50015a3ec9580b815d87c2cef715cd28df00bbf2a3c403ebf6691b3f05edd9143803ca085cff57e053eec2f8fea46ea778a68c9be885bc28225bc5f309be4a2b74d3a03945319dd3c7122fed6ff53bb8b8cb3a03c | ||
|
||
cast send 0xDDDeAfB492752FC64220ddB3E7C9f1d5CcCdFdF0 --value 10ether --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url=$RPC_URL | ||
|
||
forge script script/DeployPuffer.s.sol:DeployPuffer --rpc-url=$RPC_URL --broadcast | ||
|
Oops, something went wrong.