Skip to content

Commit

Permalink
fix: make review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
OT-kraftchain committed Dec 4, 2024
1 parent 778778d commit 8393f6b
Show file tree
Hide file tree
Showing 25 changed files with 5,486 additions and 440 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "lib/solmate"]
path = lib/solmate
url = https://github.com/transmissions11/solmate
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/openzeppelin-contracts-upgradeable"]
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,35 @@ Clone this repo:
git clone https://github.com/AxLabs/grantshares-contracts.git
```

### Neo N3 contracts
The GrantShares contracts use the [neow3j](https://neow3j.io) devpack and compiler which in turn uses Gradle as the
build tool. The contracts are located in the `main` source set.

Test can be executed with the following command. Note, that you need a running Docker deamon for the tests to work.
### Solidity contracts
Since this project also has solidity code, we need to install the foundry toolchain by running the following commands:
```shell
curl -L https://foundry.paradigm.xyz | bash
source ~/.bashrc #this might differ if using a different shell
foundryup
```

### Testing
After installing these, the
tests can be executed with the following command (Note, that you need a running Docker deamon for the tests to work):

```shell
./gradlew test
```

## Deployment

The scripts and configurations to deploy the contracts are in the `deploy` source set.
### Neo N3 contracts
The scripts and configurations to deploy the neoN3 contracts are in the `deploy` source set.
Some basic scripts for invoking the contracts via the neow3j SDK are also located there.

### Solidity contracts
//TODO: Add deployment instructions for solidity contracts

## Security Audit

The smart contracts have been audited by [Red4Sec](https://red4sec.com/en). The audit report can be found [here](https://bit.ly/3wZ14uI).
Expand Down
12 changes: 3 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,21 @@ tasks.withType(Test) {
}

node {
version = '18.20.5'
version = '20.18.1'
download = true
}

//task compileSolidity(type: NpxTask) {
// dependsOn('npmInstall')
// command = 'hardhat'
// args = ['compile']
//}
task compileSolidity(type : Exec) {
dependsOn('npmInstall')
commandLine 'forge', 'compile'
}
compileJava.finalizedBy('compileSolidity')

task testSolidity(type : Exec) {
task testSolidity(type: Exec) {
dependsOn('compileSolidity')
commandLine 'forge', 'test'
}
test.dependsOn('testSolidity')

neow3jCompile {
className = "com.axlabs.neo.grantshares.GrantSharesTreasury"
}
}
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ test = 'src/test/solidity'
out = 'artifacts'
libs = ['lib']

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
# See more config options https://github.com/foundry-rs/foundry/tree/master/config
3 changes: 1 addition & 2 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import fs from "fs";
import "@nomiclabs/hardhat-waffle";
import "@typechain/hardhat";
import "hardhat-preprocessor";
import { HardhatUserConfig, task } from "hardhat/config";
Expand All @@ -18,7 +17,7 @@ task("example", "Example task").setAction(example);

const config: HardhatUserConfig = {
solidity: {
version: "0.8.13",
version: "0.8.20",
settings: {
optimizer: {
enabled: true,
Expand Down
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts-upgradeable
1 change: 0 additions & 1 deletion lib/solmate
Submodule solmate deleted from c93f77
Loading

0 comments on commit 8393f6b

Please sign in to comment.