diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..bdde1d6
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..79ee123
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/deploy/java/com/axlabs/neo/grantshares/DeployConfig.java b/src/deploy/java/com/axlabs/neo/grantshares/DeployConfig.java
index e0014eb..60d1738 100644
--- a/src/deploy/java/com/axlabs/neo/grantshares/DeployConfig.java
+++ b/src/deploy/java/com/axlabs/neo/grantshares/DeployConfig.java
@@ -54,7 +54,8 @@ static ContractParameter getGovDeployConfig() {
MIN_ACCEPTANCE_RATE_KEY, Config.getIntProperty(MIN_ACCEPTANCE_RATE_KEY),
MIN_QUORUM_KEY, Config.getIntProperty(MIN_QUORUM_KEY),
THRESHOLD_KEY, Config.getIntProperty(THRESHOLD_KEY)
- ));
+ )
+ );
}
/**
@@ -94,6 +95,7 @@ static ContractParameter getTreasuryDeployConfig(Hash160 grantSharesGovHash) {
hash160(grantSharesGovHash),
fundersParam,
map(tokens),
- Config.getIntProperty(THRESHOLD_KEY));
+ Config.getIntProperty(THRESHOLD_KEY)
+ );
}
}
diff --git a/src/deploy/java/com/axlabs/neo/grantshares/Deployment.java b/src/deploy/java/com/axlabs/neo/grantshares/Deployment.java
index 798928d..9cbf295 100644
--- a/src/deploy/java/com/axlabs/neo/grantshares/Deployment.java
+++ b/src/deploy/java/com/axlabs/neo/grantshares/Deployment.java
@@ -41,7 +41,8 @@ private static Hash160 deployGrantSharesGov(AccountSigner signer) throws Throwab
"error message: " + log.getExecutions().get(0).getException());
}
Hash160 contractHash = SmartContract.calcContractHash(signer.getScriptHash(),
- res.getNefFile().getCheckSumAsInteger(), res.getManifest().getName());
+ res.getNefFile().getCheckSumAsInteger(), res.getManifest().getName()
+ );
System.out.println("GrantSharesGov Contract Hash: " + contractHash);
return contractHash;
}
@@ -50,7 +51,8 @@ private static void deployGrantSharesTreasury(Hash160 grantSharesGovHash, Accoun
CompilationUnit res = new Compiler().compile(GrantSharesTreasury.class.getCanonicalName());
TransactionBuilder builder = new ContractManagement(getNeow3j())
.deploy(res.getNefFile(), res.getManifest(),
- DeployConfig.getTreasuryDeployConfig(grantSharesGovHash))
+ DeployConfig.getTreasuryDeployConfig(grantSharesGovHash)
+ )
.signers(signer);
Hash256 txHash = builder.sign().send().getSendRawTransaction().getHash();
@@ -63,7 +65,8 @@ private static void deployGrantSharesTreasury(Hash160 grantSharesGovHash, Accoun
"error message: " + log.getExecutions().get(0).getException());
}
Hash160 contractHash = SmartContract.calcContractHash(signer.getScriptHash(),
- res.getNefFile().getCheckSumAsInteger(), res.getManifest().getName());
+ res.getNefFile().getCheckSumAsInteger(), res.getManifest().getName()
+ );
System.out.println("GrantSharesTreasury Contract Hash: " + contractHash);
}
diff --git a/src/deploy/java/com/axlabs/neo/grantshares/Invocations.java b/src/deploy/java/com/axlabs/neo/grantshares/Invocations.java
index 5e8bb4f..a9d257e 100644
--- a/src/deploy/java/com/axlabs/neo/grantshares/Invocations.java
+++ b/src/deploy/java/com/axlabs/neo/grantshares/Invocations.java
@@ -61,12 +61,15 @@ private static void endorseProposal(GrantSharesGovContract gov, Account a, int i
System.out.println(txHash.toString());
}
- static void createProposal(GrantSharesTreasuryContract treasury, GrantSharesGovContract gov, Account a) throws Throwable {
+ static void createProposal(GrantSharesTreasuryContract treasury, GrantSharesGovContract gov, Account a)
+ throws Throwable {
IntentParam intent = IntentParam.releaseTokenProposal(treasury.getScriptHash(), NeoToken.SCRIPT_HASH,
- a.getScriptHash(), BigInteger.ONE);
+ a.getScriptHash(), BigInteger.ONE
+ );
NeoApplicationLog.Execution exec = signSendAwait(
gov.createProposal(a.getScriptHash(), "https://github.com/axlabs/grantshares-dev/issues/42", -1,
- intent), a);
+ intent
+ ), a);
}
static NeoApplicationLog.Execution signSendAwait(TransactionBuilder b, Account signer) throws Throwable {
diff --git a/src/main/java/com/axlabs/neo/grantshares/GrantSharesGov.java b/src/main/java/com/axlabs/neo/grantshares/GrantSharesGov.java
index ec5fb24..301b506 100644
--- a/src/main/java/com/axlabs/neo/grantshares/GrantSharesGov.java
+++ b/src/main/java/com/axlabs/neo/grantshares/GrantSharesGov.java
@@ -1,9 +1,25 @@
package com.axlabs.neo.grantshares;
-import io.neow3j.devpack.*;
+import io.neow3j.devpack.Account;
+import io.neow3j.devpack.ByteString;
+import io.neow3j.devpack.Contract;
+import io.neow3j.devpack.ECPoint;
+import io.neow3j.devpack.Hash160;
+import io.neow3j.devpack.Helper;
+import io.neow3j.devpack.Iterator;
+import io.neow3j.devpack.List;
+import io.neow3j.devpack.Map;
import io.neow3j.devpack.Runtime;
import io.neow3j.devpack.Iterator.Struct;
-import io.neow3j.devpack.annotations.*;
+import io.neow3j.devpack.Storage;
+import io.neow3j.devpack.StorageContext;
+import io.neow3j.devpack.StorageMap;
+import io.neow3j.devpack.annotations.ContractSourceCode;
+import io.neow3j.devpack.annotations.DisplayName;
+import io.neow3j.devpack.annotations.ManifestExtra;
+import io.neow3j.devpack.annotations.OnDeployment;
+import io.neow3j.devpack.annotations.Permission;
+import io.neow3j.devpack.annotations.Safe;
import io.neow3j.devpack.constants.FindOptions;
import io.neow3j.devpack.contracts.ContractManagement;
import io.neow3j.devpack.contracts.StdLib;
@@ -20,7 +36,9 @@
@ManifestExtra(key = "Email", value = "info@grantshares.io")
@ManifestExtra(key = "Description", value = "The governing contract of the GrantShares DAO")
@ManifestExtra(key = "Website", value = "https://grantshares.io")
+//@formatter:off
@ContractSourceCode("https://github.com/AxLabs/grantshares-contracts/blob/main/src/main/java/com/axlabs/neo/grantshares/GrantSharesGov.java")
+//@formatter:on
@DisplayName("GrantSharesGov")
@SuppressWarnings("unchecked")
public class GrantSharesGov {
@@ -72,8 +90,6 @@ public class GrantSharesGov {
static Event unpaused;
@DisplayName("ProposalMigrated")
static Event1Arg migrated;
- @DisplayName("Error")
- static Event2Args error;
//endregion EVENTS
/**
@@ -242,10 +258,8 @@ public static int getProposalCount() {
*/
@Safe
public static Paginator.Paginated getProposals(int page, int itemsPerPage) throws Exception {
- if (page < 0)
- throw new Exception("[GrantSharesGov.getProposals] Page number was negative");
- if (itemsPerPage <= 0)
- throw new Exception("[GrantSharesGov.getProposals] Page number was negative or zero");
+ if (page < 0) throw new Exception("[GrantSharesGov.getProposals] Page number was negative");
+ if (itemsPerPage <= 0) throw new Exception("[GrantSharesGov.getProposals] Page number was negative or zero");
int n = Storage.getInt(getReadOnlyContext(), PROPOSALS_COUNT_KEY);
int[] pagination = Paginator.calcPagination(n, page, itemsPerPage);
List