Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowlist and Social LR #45

Merged
merged 63 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
4a39f88
some natspec
parseb Sep 15, 2023
3a0b1ad
some natsepc
parseb Sep 15, 2023
71c00a0
cosmetic
parseb Sep 16, 2023
6721229
composable LR algo, testnet populate script scaff., opentaks plugin poc,
parseb Sep 18, 2023
c6d94ad
batch admin add, module activate if missing as part of plugin install
parseb Sep 20, 2023
ea53b52
reStruct archetype data
parseb Sep 22, 2023
a4911c7
archetype struct redo, performance
parseb Sep 22, 2023
40a55e4
allowlist plus one, meeting bot scaffold, licence
parseb Sep 25, 2023
5dd0808
feat: deployments auto export, IAllowlist enforced
parseb Sep 26, 2023
3863802
Update LocalReputation.sol
parseb Sep 26, 2023
f706389
chore: remove name imprecision
parseb Sep 26, 2023
a49b111
chore: name innacuracy
parseb Sep 26, 2023
6e99357
redeployed with name name innacuracy fixed
parseb Sep 26, 2023
7170cd0
Merge branch 'dev-main' into test-dev-2
parseb Sep 26, 2023
6b801ac
Merge pull request #37 from Aut-Labs/test-dev-2
parseb Sep 26, 2023
6b0aa52
chore: readded foundry ABIs
parseb Sep 27, 2023
edbd37a
chore: CI scaffold,
parseb Sep 27, 2023
041e903
chore: ci foundryup
parseb Sep 27, 2023
7aa276f
chore: ci foundryup
parseb Sep 27, 2023
0ed142e
chore: shell option
parseb Sep 27, 2023
5c00d67
socialBotPlugin, interaction comm out
parseb Sep 29, 2023
2e769fb
feat: social bot codegen
parseb Oct 2, 2023
7f5265b
chore: fuzzdataPlacehoder temp gh env
parseb Oct 2, 2023
1a3fdf1
ci:gh test&abi gen
actions-user Oct 2, 2023
9444232
adds mai-dev ci poc fuzzdata
parseb Oct 2, 2023
cef1151
ci:gh test&abi gen
actions-user Oct 2, 2023
dec6769
chore: removes legacy interaction references
parseb Oct 2, 2023
9315720
chore: redeployed
parseb Oct 2, 2023
21a330a
ci:gh test&abi gen
actions-user Oct 2, 2023
f30242d
feat: breakdown dev
parseb Oct 2, 2023
f469fc4
ci:gh test&abi gen
actions-user Oct 2, 2023
415f1de
adds typechain
parseb Oct 3, 2023
38a6fff
fix: remove unused dependency
parseb Oct 3, 2023
783e0a4
ci readd typechain with dependency
parseb Oct 3, 2023
59e7f18
ci: forge test and typechain
actions-user Oct 3, 2023
1c2c5f2
social bot test, nova renames
parseb Oct 4, 2023
151e5cf
forge clean
parseb Oct 4, 2023
02cec0f
changes admin plugin, allowlist in moduleReg, default plugin definiti…
parseb Oct 6, 2023
62b7452
re-deployed
parseb Oct 6, 2023
46afbea
ci: forge test and typechain
actions-user Oct 6, 2023
fcd9024
Merge branch 'dev-main' into test-dev-2
parseb Oct 6, 2023
8a4d66b
ci: forge test and typechain
actions-user Oct 6, 2023
cbdd233
Merge pull request #41 from Aut-Labs/test-dev-2
parseb Oct 6, 2023
3399b5e
ci: forge test and typechain
actions-user Oct 6, 2023
57a4d23
Merge branch 'test-dev-2' into test-dev-3
parseb Oct 6, 2023
a78c223
Merge pull request #43 from Aut-Labs/test-dev-3
parseb Oct 6, 2023
bc9df1f
ci: forge test and typechain
actions-user Oct 6, 2023
8767f10
adds allowlist test, ci profile
parseb Oct 9, 2023
d1fd84a
ci: forge test
actions-user Oct 9, 2023
6a3216e
chore: deploymnet addr for populate prep
parseb Oct 10, 2023
b93f572
ci: forge test
actions-user Oct 10, 2023
f2143c9
rm ci user commits
parseb Oct 11, 2023
71364c7
chore: basic populate instance script
parseb Oct 11, 2023
a18f930
fmt
parseb Oct 11, 2023
b3fd4ae
populate script poc local
parseb Oct 11, 2023
90bb53a
chore: ignore fuzzdata
parseb Oct 12, 2023
b8bf609
rm fuzzdata
parseb Oct 12, 2023
1f057e9
local populate base 2
parseb Oct 12, 2023
60a8cd5
fuzz results skip
parseb Oct 12, 2023
d7f596b
Merge branch 'dev-main' into test-dev-2
parseb Oct 12, 2023
52a373c
adds ABIs
parseb Oct 12, 2023
cc4e225
Merge pull request #44 from Aut-Labs/test-dev-2
parseb Oct 12, 2023
ec2ca18
chore: updated deployment addresses in populate script
parseb Oct 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
59 changes: 36 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,47 @@
name: test

on: workflow_dispatch
name: wip-dev-ci

env:
FOUNDRY_PROFILE: default
FOUNDRY_PROFILE: "ci"

jobs:
check:
strategy:
fail-fast: true
on:
push:
branches:
- test-dev-2
- dev-main

name: Foundry project
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout code
uses: actions/checkout@v2

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install Node.js
uses: actions/setup-node@v2
with:
version: nightly
node-version: 18.12.1

- name: Install dependencies
run: npm install

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
run: forge t

# - name: Build with Hardhat
# run: npm run test

- name: generate types
run: npx typechain --target ethers-v5 './out/*.sol/*'

# - name: Commit changes
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Actions"
# git add .
# git commit -m "ci: forge test"
# git push
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ coverage
coverage.json
typechain
tempNet
out
cache_forge
broadcast
test/testData/LRfuzzDataOut.csv
*.csv

#Hardhat files
cache
Expand All @@ -19,3 +20,4 @@ artifacts
.openzeppelin/.session
.openzeppelin
integrationTests/autID.integration.js

3 changes: 3 additions & 0 deletions contracts/AutID.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ contract AutID is ERC2771Recipient, ERC721URIStorageUpgradeable, IAutID {
/// @param daoAddress the address of the daoAddress contract
function joinDAO(uint256 role, uint256 commitment, address daoAddress) external override {
require(role > 0 && role < 4, "Role must be between 1 and 3");
///@dev @todo consider if role commitment dependent as initial.
require(commitment > 0 && commitment < 11, "AutID: Commitment should be between 1 and 10");
require(daoAddress != address(0), "AutID: Missing DAO");
require(balanceOf(_msgSender()) == 1, "AutID: There is no AutID registered for this address.");
Expand Down Expand Up @@ -127,6 +128,8 @@ contract AutID is ERC2771Recipient, ERC721URIStorageUpgradeable, IAutID {
holderToDAOMembershipData[_msgSender()][daoAddress].isActive = false;
holderToDAOMembershipData[_msgSender()][daoAddress].commitment = 0;

/// @dev @todo this does not change Nova storage isMember[_msgSender] will still return true (has dos implications on admin check allowlist spec)

emit DAOWithdrown(daoAddress, _msgSender());
}

Expand Down
27 changes: 0 additions & 27 deletions contracts/IInteraction.sol

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ pragma solidity 0.8.19;
* @dev Interface for local reputation algorythm
*/

struct periodData {
int32 aDiffMembersLP; // difference in member nr. between periods
int32 bMembersLastLP; // how many members last period
uint64 cAverageRepLP; // avg. reputation
uint64 dAverageCommitmentLP; // avg. commitment
uint64 ePerformanceLP; // points performance score
}

struct groupState {
uint64 lastPeriod; //lastPeriod: Last period in which the LR was updated.
uint64 TCL; //TCL (Total Commitment Level in the Community): Sum of all members' Commitment Levels (between 1 and 10).
Expand All @@ -16,7 +24,7 @@ struct groupState {
uint32 p; // period length
bytes32 commitHash;
uint256 lrUpdatesPerPeriod; // how many iS updates were executed // used to zero TCP // ensures LRs updated
int64[4] archetypeData; // difference in member nr. between periods | how many members last period | avg. reputation | avg. commitment
periodData periodNovaParameters;
}

struct individualState {
Expand Down Expand Up @@ -50,25 +58,26 @@ interface ILocalReputation {
error PeriodUnelapsed();
error ZeroUnallawed();
error MaxK();
error k1MaxPointPerInteraction();

function initialize(address dao_) external;

function interaction(bytes calldata msgData, address agent) external;

function setInteractionWeights(address plugin_, bytes[] memory datas, uint256[] memory points) external;
function setInteractionWeights(address plugin_, bytes[] memory datas, uint16[] memory points) external;

function getGroupState(address nova_) external view returns (groupState memory);

function getIndividualState(address agent_, address nova_) external view returns (individualState memory);

function setKP(uint16 k, uint32 p, uint16 penalty, address target_) external;
function setKP(uint16 k, uint32 p, uint8 penalty, address target_) external;

function updateCommitmentLevels(address nova_) external;
function updateCommitmentLevels(address nova_) external returns (uint256[] memory);

function updateIndividualLR(address who_, address group_) external returns (uint256);
function periodicGroupStateUpdate(address group_) external returns (uint256 nextUpdateAt);

function getArchetypeData(address nova_) external view returns (int64[4] memory);
function getPeriodNovaParameters(address nova_) external view returns (periodData memory);

function getAvReputationAndCommitment(address nova_) external view returns (uint256 sumCommit, uint256 sumRep);

Expand Down
55 changes: 0 additions & 55 deletions contracts/Interaction.sol

This file was deleted.

Loading