Skip to content

Commit

Permalink
Feat/#40 Send proposal and execute (#48)
Browse files Browse the repository at this point in the history
* feat: (#40) Add events for proposal and execution

* fix: Changes after review

* fix: Update evmVersion
  • Loading branch information
OT-kraftchain authored Jan 17, 2025
1 parent 905e359 commit 365987f
Show file tree
Hide file tree
Showing 19 changed files with 7,035 additions and 17,497 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib/
src/**/resources/
36 changes: 36 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": true
}
},
{
"files": "*.js",
"options": {
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "all"
}
},
{
"files": "*.ts",
"options": {
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "all"
}
}
]
}
12 changes: 10 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ plugins {
id "com.github.node-gradle.node" version "7.1.0"
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

group 'io.grantshares'
version '1.0.0'
Expand Down Expand Up @@ -55,6 +57,12 @@ task testSolidity(type: Exec) {
}
test.dependsOn('testSolidity')

task contract(type : Exec) {
dependsOn('npmInstall')
// use locally installed node by the gradle-node-plugin
commandLine '.gradle/nodejs/node-v20.18.1-darwin-arm64/bin/npx', 'hardhat', 'run', './src/deploy/typescript/deploy_relayer.ts'
}

neow3jCompile {
className = "com.axlabs.neo.grantshares.GrantSharesTreasury"
}
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ src = 'src/main/solidity'
test = 'src/test/solidity'
out = 'artifacts'
libs = ['lib']
solc = "0.8.28"

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
53 changes: 40 additions & 13 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,60 @@
import fs from "fs";
import "@typechain/hardhat";
import "hardhat-preprocessor";
import { HardhatUserConfig, task } from "hardhat/config";

import example from "./src/deploy/typescript/example";
import fs from 'fs';
import '@typechain/hardhat';
import 'hardhat-preprocessor';
import '@openzeppelin/hardhat-upgrades';
import { HardhatUserConfig, task } from 'hardhat/config';
import checkBalance from './src/deploy/typescript/checkBalance';

function getRemappings() {
return fs
.readFileSync("remappings.txt", "utf8")
.split("\n")
.readFileSync('remappings.txt', 'utf8')
.split('\n')
.filter(Boolean)
.map((line) => line.trim().split("="));
.map((line) => line.trim().split('='));
}

task("example", "Example task").setAction(example);
task('checkBalance', 'Check deployer balance').setAction(checkBalance);

//!!!TEST MNEMONIC!!! - DO NOT USE IN PRODUCTION
const accountMnemonic =
process.env.MNEMONIC || 'cabin remain mom audit drive system nurse sniff mule odor approve bread';

const config: HardhatUserConfig = {
solidity: {
version: "0.8.20",
version: '0.8.28',
settings: {
evmVersion: 'shanghai',
optimizer: {
enabled: true,
runs: 200,
},
},
},
networks: {
hardhat: {
forking: {
url: 'https://sepolia.optimism.io',
},
accounts: {
mnemonic: accountMnemonic,
},
chainId: 11155111,
gas: 'auto',
gasMultiplier: 1,
},
op_sepolia: {
url: 'https://sepolia.optimism.io',
accounts: {
mnemonic: accountMnemonic,
},
chainId: 11155420,
gas: 'auto',
gasMultiplier: 1,
},
},
paths: {
sources: "./src/main/solidity", // Use ./src rather than ./contracts as Hardhat expects
cache: "./cache_hardhat", // Use a different cache for Hardhat than Foundry
sources: './src/main/solidity', // Use ./src rather than ./contracts as Hardhat expects
cache: './cache_hardhat', // Use a different cache for Hardhat than Foundry
},
// This fully resolves paths for imports in the ./lib directory for Hardhat
//@ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion lib/forge-std
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts-upgradeable
Loading

0 comments on commit 365987f

Please sign in to comment.