-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
socialBotPlugin, interaction comm out
- Loading branch information
Showing
192 changed files
with
499 additions
and
1,303,975 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,12 +21,9 @@ jobs: | |
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Install Foundry | ||
run: | | ||
curl -L https://foundry.paradigm.xyz | bash | ||
source /home/runner/.bashrc | ||
foundryup | ||
shell: bash | ||
- name: "Install Foundry" | ||
uses: "foundry-rs/foundry-toolchain@v1" | ||
|
||
|
||
- name: Run Forge tests | ||
run: forge t | ||
|
@@ -45,5 +42,5 @@ jobs: | |
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Actions" | ||
git add . | ||
git commit -m "chore:gh CI test" | ||
git commit -m "ci:gh test&abi gen" | ||
git push |
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,27 +1,27 @@ | ||
//SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.19; | ||
// //SPDX-License-Identifier: MIT | ||
// pragma solidity 0.8.19; | ||
|
||
import "@openzeppelin/contracts/utils/Counters.sol"; | ||
import "./daoUtils/interfaces/get/IDAOAdmin.sol"; | ||
// import "@openzeppelin/contracts/utils/Counters.sol"; | ||
// import "./daoUtils/interfaces/get/IDAOAdmin.sol"; | ||
|
||
interface IInteraction { | ||
event InteractionIndexIncreased(address member, uint256 total); | ||
event AddressAllowed(address addr); | ||
// interface IInteraction { | ||
// event InteractionIndexIncreased(address member, uint256 total); | ||
// event AddressAllowed(address addr); | ||
|
||
struct InteractionModel { | ||
address member; | ||
uint256 taskID; | ||
address contractAddress; | ||
} | ||
// struct InteractionModel { | ||
// address member; | ||
// uint256 taskID; | ||
// address contractAddress; | ||
// } | ||
|
||
function dao() external view returns (IDAOAdmin); | ||
// function dao() external view returns (IDAOAdmin); | ||
|
||
function allowAccess(address addr) external; | ||
// function allowAccess(address addr) external; | ||
|
||
function addInteraction(uint256 activityID, address member) external; | ||
// function addInteraction(uint256 activityID, address member) external; | ||
|
||
// view | ||
function getInteraction(uint256 interactionID) external view returns (InteractionModel memory); | ||
// // view | ||
// function getInteraction(uint256 interactionID) external view returns (InteractionModel memory); | ||
|
||
function getInteractionsIndexPerAddress(address user) external view returns (uint256); | ||
} | ||
// function getInteractionsIndexPerAddress(address user) external view returns (uint256); | ||
// } |
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,55 +1,55 @@ | ||
//SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.19; | ||
// //SPDX-License-Identifier: MIT | ||
// pragma solidity 0.8.19; | ||
|
||
import "@openzeppelin/contracts/utils/Counters.sol"; | ||
import "./daoUtils/interfaces/get/IDAOAdmin.sol"; | ||
import "./daoUtils/interfaces/get/IDAOModules.sol"; | ||
import "./IInteraction.sol"; | ||
// import "@openzeppelin/contracts/utils/Counters.sol"; | ||
// import "./daoUtils/interfaces/get/IDAOAdmin.sol"; | ||
// import "./daoUtils/interfaces/get/IDAOModules.sol"; | ||
// import "./IInteraction.sol"; | ||
|
||
contract Interaction is IInteraction { | ||
using Counters for Counters.Counter; | ||
// contract Interaction is IInteraction { | ||
// using Counters for Counters.Counter; | ||
|
||
Counters.Counter private idCounter; | ||
// Counters.Counter private idCounter; | ||
|
||
mapping(address => bool) isAllowed; | ||
// mapping(address => bool) isAllowed; | ||
|
||
modifier onlyAllowed() { | ||
require(isAllowed[msg.sender], "Not allowed to transfer interactions"); | ||
_; | ||
} | ||
// modifier onlyAllowed() { | ||
// require(isAllowed[msg.sender], "Not allowed to transfer interactions"); | ||
// _; | ||
// } | ||
|
||
mapping(uint256 => InteractionModel) interactions; | ||
mapping(address => uint256) interactionsIndex; | ||
// mapping(uint256 => InteractionModel) interactions; | ||
// mapping(address => uint256) interactionsIndex; | ||
|
||
IDAOAdmin public override dao; | ||
// IDAOAdmin public override dao; | ||
|
||
constructor() { | ||
dao = IDAOAdmin(msg.sender); | ||
} | ||
// constructor() { | ||
// dao = IDAOAdmin(msg.sender); | ||
// } | ||
|
||
function allowAccess(address addr) public override { | ||
require(dao.isAdmin(msg.sender) || IDAOModules(address(dao)).pluginRegistry() == msg.sender, "Not allowed"); | ||
isAllowed[addr] = true; | ||
// function allowAccess(address addr) public override { | ||
// require(dao.isAdmin(msg.sender) || IDAOModules(address(dao)).pluginRegistry() == msg.sender, "Not allowed"); | ||
// isAllowed[addr] = true; | ||
|
||
emit AddressAllowed(addr); | ||
} | ||
// emit AddressAllowed(addr); | ||
// } | ||
|
||
function addInteraction(uint256 activityID, address member) public override onlyAllowed { | ||
InteractionModel memory model = InteractionModel(member, activityID, msg.sender); | ||
// function addInteraction(uint256 activityID, address member) public override onlyAllowed { | ||
// InteractionModel memory model = InteractionModel(member, activityID, msg.sender); | ||
|
||
idCounter.increment(); | ||
interactions[idCounter.current()] = model; | ||
interactionsIndex[member]++; | ||
// idCounter.increment(); | ||
// interactions[idCounter.current()] = model; | ||
// interactionsIndex[member]++; | ||
|
||
emit InteractionIndexIncreased(member, interactionsIndex[member]); | ||
} | ||
// emit InteractionIndexIncreased(member, interactionsIndex[member]); | ||
// } | ||
|
||
// view | ||
function getInteraction(uint256 interactionID) public view override returns (InteractionModel memory) { | ||
return interactions[interactionID]; | ||
} | ||
// // view | ||
// function getInteraction(uint256 interactionID) public view override returns (InteractionModel memory) { | ||
// return interactions[interactionID]; | ||
// } | ||
|
||
function getInteractionsIndexPerAddress(address user) public view override returns (uint256) { | ||
return interactionsIndex[user]; | ||
} | ||
} | ||
// function getInteractionsIndexPerAddress(address user) public view override returns (uint256) { | ||
// return interactionsIndex[user]; | ||
// } | ||
// } |
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,25 +1,25 @@ | ||
//SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.19; | ||
// //SPDX-License-Identifier: MIT | ||
// pragma solidity 0.8.19; | ||
|
||
import "../interfaces/get/IDAOInteractions.sol"; | ||
import "../../Interaction.sol"; | ||
// import "../interfaces/get/IDAOInteractions.sol"; | ||
// import "../../Interaction.sol"; | ||
|
||
/// @title DAOExpander | ||
/// @notice The extension of each DAO that integrates Aut | ||
/// @dev The extension of each DAO that integrates Aut | ||
abstract contract DAOInteractions is IDAOInteractions { | ||
Interaction private interactions; | ||
// /// @title DAOExpander | ||
// /// @notice The extension of each DAO that integrates Aut | ||
// /// @dev The extension of each DAO that integrates Aut | ||
// abstract contract DAOInteractions is IDAOInteractions { | ||
// Interaction private interactions; | ||
|
||
function _deployInteractions() internal { | ||
require(address(interactions) == address(0)); | ||
interactions = new Interaction(); | ||
} | ||
// function _deployInteractions() internal { | ||
// require(address(interactions) == address(0)); | ||
// interactions = new Interaction(); | ||
// } | ||
|
||
function getInteractionsAddr() public view override returns (address) { | ||
return address(interactions); | ||
} | ||
// function getInteractionsAddr() public view override returns (address) { | ||
// return address(interactions); | ||
// } | ||
|
||
function getInteractionsPerUser(address member) public view override returns (uint256) { | ||
return interactions.getInteractionsIndexPerAddress(member); | ||
} | ||
} | ||
// function getInteractionsPerUser(address member) public view override returns (uint256) { | ||
// return interactions.getInteractionsIndexPerAddress(member); | ||
// } | ||
// } |
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
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
Oops, something went wrong.