diff --git a/audits/README.md b/audits/README.md index cb7a606..bbe8c83 100644 --- a/audits/README.md +++ b/audits/README.md @@ -5,3 +5,7 @@ This section contains audit-related materials. An internal audit with a focus on Service Staking Mech Usage contracts is located in this folder: [internal audit](https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/audits/internal). +### Internal audit +An internal audit with a focus on social contribute +contracts is located in this folder: [internal audit 1](https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/audits/internal1). + diff --git a/audits/internal1/README.md b/audits/internal1/README.md new file mode 100644 index 0000000..c4b81ab --- /dev/null +++ b/audits/internal1/README.md @@ -0,0 +1,37 @@ +# Internal audit of autonolas-staking-programmes +The review has been performed based on the contract code in the following repository:
+`https://github.com/valory-xyz/autonolas-staking-programmes`
+commit: `v1.4.0-pre-internal-audit` or `585003faeec5dff2fd96a326f07c3e809dc32898`
+ +## Objectives +The audit focused on contracts in this repo.
+ + +### Flatten version +Flatten version of contracts. [contracts](https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/audits/internal1/analysis/contracts) + +### ERC20/ERC721 checks +N/A + +### Security issues. Updated 23-10-2024 +#### Problems found instrumentally +Several checks are obtained automatically. They are commented.
+All automatic warnings are listed in the following file, concerns of which we address in more detail below:
+[slither-full](https://github.com/valory-xyz/autonolas-staking-programmes/blob/main/audits/internal1/analysis/slither_full.txt) + +### Issue +1. Fixing reentrancy unstake() +``` +more CEI, + IToken(serviceRegistry).transfer(msg.sender, serviceId); = reentrancy via msg.sender as contract. + // Zero the service info: the service is out of the contribute records, however multisig activity is still valid + // If the same service is staked back, the multisig activity continues being tracked + IContributors(contributorsProxy).setServiceInfoForId(msg.sender, 0, 0, address(0), address(0)); + +``` +2. cyclic initialize(address _manager) +``` +Remove params in proxy init() / or setup manage as msg.sender. +``` + + diff --git a/audits/internal1/analysis/contracts/ContributeActivityChecker-flatten.sol b/audits/internal1/analysis/contracts/ContributeActivityChecker-flatten.sol new file mode 100644 index 0000000..c273ddd --- /dev/null +++ b/audits/internal1/analysis/contracts/ContributeActivityChecker-flatten.sol @@ -0,0 +1,76 @@ +// Sources flattened with hardhat v2.22.4 https://hardhat.org + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +// Contributors interface +interface IContributors { + function mapMutisigActivities(address multisig) external view returns (uint256); +} + +/// @dev Zero address. +error ZeroAddress(); + +/// @dev Zero value. +error ZeroValue(); + +/// @title ContributeActivityChecker - Smart contract for performing contributors service staking activity check +/// @author Aleksandr Kuperman - +/// @author Andrey Lebedev - +/// @author Tatiana Priemova - +/// @author David Vilela - +contract ContributeActivityChecker { + // Liveness ratio in the format of 1e18 + uint256 public immutable livenessRatio; + // Contributors proxy contract address + address public immutable contributorsProxy; + + /// @dev StakingNativeToken initialization. + /// @param _contributorsProxy Contributors proxy contract address. + /// @param _livenessRatio Liveness ratio in the format of 1e18. + constructor(address _contributorsProxy, uint256 _livenessRatio) { + // Check the zero address + if (_contributorsProxy == address(0)) { + revert ZeroAddress(); + } + + // Check for zero value + if (_livenessRatio == 0) { + revert ZeroValue(); + } + + contributorsProxy = _contributorsProxy; + livenessRatio = _livenessRatio; + } + + /// @dev Gets service multisig nonces. + /// @param multisig Service multisig address. + /// @return nonces Set of a single service multisig nonce. + function getMultisigNonces(address multisig) external view virtual returns (uint256[] memory nonces) { + nonces = new uint256[](1); + // The nonce is equal to the social off-chain activity corresponding to a multisig activity + nonces[0] = IContributors(contributorsProxy).mapMutisigActivities(multisig); + } + + /// @dev Checks if the service multisig liveness ratio passes the defined liveness threshold. + /// @notice The formula for calculating the ratio is the following: + /// currentNonce - service multisig nonce at time now (block.timestamp); + /// lastNonce - service multisig nonce at the previous checkpoint or staking time (tsStart); + /// ratio = (currentNonce - lastNonce) / (block.timestamp - tsStart). + /// @param curNonces Current service multisig set of a single nonce. + /// @param lastNonces Last service multisig set of a single nonce. + /// @param ts Time difference between current and last timestamps. + /// @return ratioPass True, if the liveness ratio passes the check. + function isRatioPass( + uint256[] memory curNonces, + uint256[] memory lastNonces, + uint256 ts + ) external view virtual returns (bool ratioPass) { + // If the checkpoint was called in the exact same block, the ratio is zero + // If the current nonce is not greater than the last nonce, the ratio is zero + if (ts > 0 && curNonces[0] > lastNonces[0]) { + uint256 ratio = ((curNonces[0] - lastNonces[0]) * 1e18) / ts; + ratioPass = (ratio >= livenessRatio); + } + } +} diff --git a/audits/internal1/analysis/contracts/ContributeManager-flatten.sol b/audits/internal1/analysis/contracts/ContributeManager-flatten.sol new file mode 100644 index 0000000..8247621 --- /dev/null +++ b/audits/internal1/analysis/contracts/ContributeManager-flatten.sol @@ -0,0 +1,480 @@ +// Sources flattened with hardhat v2.22.4 https://hardhat.org +pragma solidity ^0.8.25; + +// SPDX-License-Identifier: MIT +// Contributors interface +interface IContributors { + /// @dev Sets service info for the social id. + /// @param serviceOwner Service owner. + /// @param socialId Social id. + /// @param serviceId Service Id. + /// @param multisig Service multisig address. + /// @param stakingInstance Staking instance address. + function setServiceInfoForId( + address serviceOwner, + uint256 socialId, + uint256 serviceId, + address multisig, + address stakingInstance + ) external; + + /// @dev Gets service info corresponding to a specified social Id. + /// @param serviceOwner Service owner. + /// @return socialId Social Id. + /// @return serviceId Corresponding service Id. + /// @return multisig Corresponding service multisig. + /// @return stakingInstance Staking instance address. + function mapSocialIdServiceInfo(address serviceOwner) external view + returns (uint256 socialId, uint256 serviceId, address multisig, address stakingInstance); +} + + +// Service registry related interface +interface IService { + struct AgentParams { + // Number of agent instances + uint32 slots; + // Bond per agent instance + uint96 bond; + } + + /// @dev Creates a new service. + /// @param serviceOwner Individual that creates and controls a service. + /// @param token ERC20 token address for the security deposit, or ETH. + /// @param configHash IPFS hash pointing to the config metadata. + /// @param agentIds Canonical agent Ids. + /// @param agentParams Number of agent instances and required bond to register an instance in the service. + /// @param threshold Threshold for a multisig composed by agents. + /// @return serviceId Created service Id. + function create( + address serviceOwner, + address token, + bytes32 configHash, + uint32[] memory agentIds, + AgentParams[] memory agentParams, + uint32 threshold + ) external returns (uint256 serviceId); + + /// @dev Activates the service and its sensitive components. + /// @param serviceId Correspondent service Id. + /// @return success True, if function executed successfully. + function activateRegistration(uint256 serviceId) external payable returns (bool success); + + /// @dev Registers agent instances. + /// @param serviceId Service Id to be updated. + /// @param agentInstances Agent instance addresses. + /// @param agentIds Canonical Ids of the agent correspondent to the agent instance. + /// @return success True, if function executed successfully. + function registerAgents( + uint256 serviceId, + address[] memory agentInstances, + uint32[] memory agentIds + ) external payable returns (bool success); + + /// @dev Creates multisig instance controlled by the set of service agent instances and deploys the service. + /// @param serviceId Correspondent service Id. + /// @param multisigImplementation Multisig implementation address. + /// @param data Data payload for the multisig creation. + /// @return multisig Address of the created multisig. + function deploy( + uint256 serviceId, + address multisigImplementation, + bytes memory data + ) external returns (address multisig); + + /// @dev Gets the serviceRegistry address. + /// @return serviceRegistry address. + function serviceRegistry() external returns (address); + + /// @dev Gets the serviceRegistryTokenUtility address. + /// @return serviceRegistryTokenUtility address. + function serviceRegistryTokenUtility() external returns (address); + + /// @dev Gets the service instance from the map of services. + /// @param serviceId Service Id. + /// @return securityDeposit Registration activation deposit. + /// @return multisig Service multisig address. + /// @return configHash IPFS hashes pointing to the config metadata. + /// @return threshold Agent instance signers threshold. + /// @return maxNumAgentInstances Total number of agent instances. + /// @return numAgentInstances Actual number of agent instances. + /// @return state Service state. + function mapServices(uint256 serviceId) external view returns ( + uint96 securityDeposit, + address multisig, + bytes32 configHash, + uint32 threshold, + uint32 maxNumAgentInstances, + uint32 numAgentInstances, + uint8 state + ); +} + +// Staking interface +interface IStaking { + /// @dev Gets service staking token. + /// @return Service staking token address. + function stakingToken() external view returns (address); + + /// @dev Gets minimum service staking deposit value required for staking. + /// @return Minimum service staking deposit. + function minStakingDeposit() external view returns (uint256); + + /// @dev Gets number of required agent instances in the service. + /// @return Number of agent instances. + function numAgentInstances() external view returns (uint256); + + /// @dev Gets the service threshold. + /// @return Threshold. + function threshold() external view returns (uint256); + + /// @dev Stakes the service. + /// @param serviceId Service Id. + function stake(uint256 serviceId) external; + + /// @dev Unstakes the service with collected reward, if available. + /// @param serviceId Service Id. + /// @return reward Staking reward. + function unstake(uint256 serviceId) external returns (uint256); + + /// @dev Claims rewards for the service without an additional checkpoint call. + /// @param serviceId Service Id. + /// @return Staking reward. + function claim(uint256 serviceId) external returns (uint256); + + /// @dev Verifies a service staking contract instance. + /// @param instance Service staking proxy instance. + /// @return True, if verification is successful. + function verifyInstance(address instance) external view returns (bool); +} + +// Token interface +interface IToken { + /// @dev Transfers the token amount. + /// @param to Address to transfer to. + /// @param amount The amount to transfer. + /// @return True if the function execution is successful. + function transfer(address to, uint256 amount) external returns (bool); + + /// @dev Transfers the token amount that was previously approved up until the maximum allowance. + /// @param from Account address to transfer from. + /// @param to Account address to transfer to. + /// @param amount Amount to transfer to. + /// @return True if the function execution is successful. + function transferFrom(address from, address to, uint256 amount) external returns (bool); + + /// @dev Sets `amount` as the allowance of `spender` over the caller's tokens. + /// @param spender Account address that will be able to transfer tokens on behalf of the caller. + /// @param amount Token amount. + /// @return True if the function execution is successful. + function approve(address spender, uint256 amount) external returns (bool); +} + +// Multisig interface +interface IMultisig { + /// @dev Returns array of owners. + /// @return Array of Safe owners. + function getOwners() external view returns (address[] memory); +} + +/// @dev Zero address. +error ZeroAddress(); + +/// @dev Zero value. +error ZeroValue(); + +/// @dev Service is already created and staked for the contributor. +/// @param socialId Social Id. +/// @param serviceId Service Id. +/// @param multisig Multisig address. +error ServiceAlreadyStaked(uint256 socialId, uint256 serviceId, address multisig); + +/// @dev Wrong staking instance. +/// @param stakingInstance Staking instance address. +error WrongStakingInstance(address stakingInstance); + +/// @dev Wrong provided service setup. +/// @param socialId Social Id. +/// @param serviceId Service Id. +/// @param multisig Multisig address. +error WrongServiceSetup(uint256 socialId, uint256 serviceId, address multisig); + +/// @dev Service is not defined for the social Id. +/// @param socialId Social Id. +error ServiceNotDefined(uint256 socialId); + +/// @dev Wrong service owner. +/// @param serviceId Service Id. +/// @param sender Sender address. +/// @param serviceOwner Actual service owner. +error ServiceOwnerOnly(uint256 serviceId, address sender, address serviceOwner); + +/// @title ContributeManager - Smart contract for managing services for contributors +/// @author Aleksandr Kuperman - +/// @author Andrey Lebedev - +/// @author Tatiana Priemova - +/// @author David Vilela - +contract ContributeManager { + event CreatedAndStaked(uint256 indexed socialId, address indexed serviceOwner, uint256 serviceId, + address indexed multisig, address stakingInstance); + event Staked(uint256 indexed socialId, address indexed serviceOwner, uint256 serviceId, + address indexed multisig, address stakingInstance); + event Unstaked(uint256 indexed socialId, address indexed serviceOwner, uint256 serviceId, + address indexed multisig, address stakingInstance); + event Claimed(uint256 indexed socialId, address indexed serviceOwner, uint256 serviceId, + address indexed multisig, address stakingInstance); + + // Number of agent instances + uint256 public constant NUM_AGENT_INSTANCES = 1; + // Threshold + uint256 public constant THRESHOLD = 1; + // Contributor agent Id + uint256 public immutable agentId; + // Contributor service config hash + bytes32 public immutable configHash; + // Contributors proxy address + address public immutable contributorsProxy; + // Service manager address + address public immutable serviceManager; + // OLAS token address + address public immutable olas; + // Service registry address + address public immutable serviceRegistry; + // Service registry token utility address + address public immutable serviceRegistryTokenUtility; + // Staking factory address + address public immutable stakingFactory; + // Safe multisig processing contract address + address public immutable safeMultisig; + // Safe fallback handler + address public immutable fallbackHandler; + + // Nonce + uint256 internal nonce; + + /// @dev ContributeManager constructor. + /// @param _contributorsProxy Contributors proxy address. + /// @param _serviceManager Service manager address. + /// @param _olas OLAS token address. + /// @param _stakingFactory Staking factory address. + /// @param _safeMultisig Safe multisig address. + /// @param _fallbackHandler Multisig fallback handler address. + /// @param _agentId Contributor agent Id. + /// @param _configHash Contributor service config hash. + constructor( + address _contributorsProxy, + address _serviceManager, + address _olas, + address _stakingFactory, + address _safeMultisig, + address _fallbackHandler, + uint256 _agentId, + bytes32 _configHash + ) { + // Check for zero addresses + if (_contributorsProxy == address(0) || _serviceManager == address(0) || _olas == address(0) || + _stakingFactory == address(0) || _safeMultisig == address(0) || _fallbackHandler == address(0)) { + revert ZeroAddress(); + } + + // Check for zero values + if (_agentId == 0 || _configHash == 0) { + revert ZeroValue(); + } + + agentId = _agentId; + configHash = _configHash; + + contributorsProxy = _contributorsProxy; + serviceManager = _serviceManager; + olas = _olas; + stakingFactory = _stakingFactory; + safeMultisig = _safeMultisig; + fallbackHandler = _fallbackHandler; + serviceRegistry = IService(serviceManager).serviceRegistry(); + serviceRegistryTokenUtility = IService(serviceManager).serviceRegistryTokenUtility(); + } + + /// @dev Creates and deploys a service for the contributor. + /// @param token Staking token address. + /// @param minStakingDeposit Min staking deposit value. + /// @return serviceId Minted service Id. + /// @return multisig Service multisig. + function _createAndDeploy( + address token, + uint256 minStakingDeposit + ) internal returns (uint256 serviceId, address multisig) { + // Set agent params + IService.AgentParams[] memory agentParams = new IService.AgentParams[](NUM_AGENT_INSTANCES); + agentParams[0] = IService.AgentParams(uint32(NUM_AGENT_INSTANCES), uint96(minStakingDeposit)); + + // Set agent Ids + uint32[] memory agentIds = new uint32[](NUM_AGENT_INSTANCES); + agentIds[0] = uint32(agentId); + + // Set agent instances as [msg.sender] + address[] memory instances = new address[](NUM_AGENT_INSTANCES); + instances[0] = msg.sender; + + // Create a service owned by this contract + serviceId = IService(serviceManager).create(address(this), token, configHash, agentIds, + agentParams, uint32(THRESHOLD)); + + // Activate registration (1 wei as a deposit wrapper) + IService(serviceManager).activateRegistration{value: 1}(serviceId); + + // Register msg.sender as an agent instance (numAgentInstances wei as a bond wrapper) + IService(serviceManager).registerAgents{value: NUM_AGENT_INSTANCES}(serviceId, instances, agentIds); + + // Prepare Safe multisig data + uint256 localNonce = nonce; + uint256 randomNonce = uint256(keccak256(abi.encodePacked(block.timestamp, msg.sender, localNonce))); + bytes memory data = abi.encodePacked(address(0), fallbackHandler, address(0), address(0), uint256(0), + randomNonce, "0x"); + // Deploy the service + multisig = IService(serviceManager).deploy(serviceId, safeMultisig, data); + + // Update the nonce + nonce = localNonce + 1; + } + + /// @dev Stakes the already deployed service. + /// @param socialId Social Id. + /// @param serviceId Service Id. + /// @param multisig Corresponding service multisig. + /// @param stakingInstance Staking instance. + function _stake(uint256 socialId, uint256 serviceId, address multisig, address stakingInstance) internal { + // Add the service into its social Id corresponding record + IContributors(contributorsProxy).setServiceInfoForId(msg.sender, socialId, serviceId, multisig, stakingInstance); + + // Approve service NFT for the staking instance + IToken(serviceRegistry).approve(stakingInstance, serviceId); + + // Stake the service + IStaking(stakingInstance).stake(serviceId); + } + + /// @dev Creates and deploys a service for the contributor, and stakes it with a specified staking contract. + /// @notice The service cannot be registered again if it is currently staked. + /// @param socialId Contributor social Id. + /// @param stakingInstance Contribute staking instance address. + function createAndStake(uint256 socialId, address stakingInstance) external payable { + // Check for zero value + if (socialId == 0) { + revert ZeroValue(); + } + + // Check for existing service corresponding to the msg.sender + (, uint256 serviceId, address multisig, ) = IContributors(contributorsProxy).mapSocialIdServiceInfo(msg.sender); + if (serviceId > 0) { + revert ServiceAlreadyStaked(socialId, serviceId, multisig); + } + + // Check for staking instance validity + if(!IStaking(stakingFactory).verifyInstance(stakingInstance)) { + revert WrongStakingInstance(stakingInstance); + } + + // Get the token info from the staking contract + // If this call fails, it means the staking contract does not have a token and is not compatible + address token = IStaking(stakingInstance).stakingToken(); + // Check the token address + if (token != olas) { + revert WrongStakingInstance(stakingInstance); + } + + // Get other service info for staking + uint256 minStakingDeposit = IStaking(stakingInstance).minStakingDeposit(); + uint256 numAgentInstances = IStaking(stakingInstance).numAgentInstances(); + uint256 threshold = IStaking(stakingInstance).threshold(); + // Check for number of agent instances that must be equal to one, + // since msg.sender is the only service multisig owner + if (numAgentInstances != NUM_AGENT_INSTANCES || threshold != THRESHOLD) { + revert WrongStakingInstance(stakingInstance); + } + + // Calculate the total bond required for the service deployment: + uint256 totalBond = (1 + NUM_AGENT_INSTANCES) * minStakingDeposit; + + // Transfer the total bond amount from the contributor + IToken(olas).transferFrom(msg.sender, address(this), totalBond); + // Approve token for the serviceRegistryTokenUtility contract + IToken(olas).approve(serviceRegistryTokenUtility, totalBond); + + // Create and deploy service + (serviceId, multisig) = _createAndDeploy(olas, minStakingDeposit); + + // Stake the service + _stake(socialId, serviceId, multisig, stakingInstance); + + emit CreatedAndStaked(socialId, msg.sender, serviceId, multisig, stakingInstance); + } + + /// @dev Stakes the already deployed service. + /// @param socialId Social Id. + /// @param serviceId Service Id. + /// @param stakingInstance Staking instance. + function stake(uint256 socialId, uint256 serviceId, address stakingInstance) external { + // Check for existing service corresponding to the msg.sender + (, uint256 serviceIdCheck, address multisig, ) = IContributors(contributorsProxy).mapSocialIdServiceInfo(msg.sender); + if (serviceIdCheck > 0) { + revert ServiceAlreadyStaked(socialId, serviceIdCheck, multisig); + } + + // Get the service multisig + (, multisig, , , , , ) = IService(serviceRegistry).mapServices(serviceId); + + // Check that the service multisig owner is msg.sender + uint256 numAgentInstances = IStaking(stakingInstance).numAgentInstances(); + address[] memory multisigOwners = IMultisig(multisig).getOwners(); + if (multisigOwners.length != numAgentInstances || multisigOwners[0] != msg.sender) { + revert WrongServiceSetup(socialId, serviceId, multisig); + } + + // Transfer the service NFT + IToken(serviceRegistry).transferFrom(msg.sender, address(this), serviceId); + + // Stake the service + _stake(socialId, serviceId, multisig, stakingInstance); + + emit Staked(socialId, msg.sender, serviceId, multisig, stakingInstance); + } + + /// @dev Unstakes service Id corresponding to the msg.sender and clears the contributor record. + function unstake() external { + // Check for existing service corresponding to the social Id + (uint256 socialId, uint256 serviceId, address multisig, address stakingInstance) = + IContributors(contributorsProxy).mapSocialIdServiceInfo(msg.sender); + if (serviceId == 0) { + revert ServiceNotDefined(socialId); + } + + // Unstake the service + IStaking(stakingInstance).unstake(serviceId); + + // Transfer the service back to the original owner + IToken(serviceRegistry).transfer(msg.sender, serviceId); + + // Zero the service info: the service is out of the contribute records, however multisig activity is still valid + // If the same service is staked back, the multisig activity continues being tracked + IContributors(contributorsProxy).setServiceInfoForId(msg.sender, 0, 0, address(0), address(0)); + + emit Unstaked(socialId, msg.sender, serviceId, multisig, stakingInstance); + } + + /// @dev Claims rewards for the service corresponding to msg.sender. + /// @return reward Staking reward. + function claim() external returns (uint256 reward) { + // Check for existing service corresponding to the social Id + (uint256 socialId, uint256 serviceId, address multisig, address stakingInstance) = + IContributors(contributorsProxy).mapSocialIdServiceInfo(msg.sender); + if (serviceId == 0) { + revert ServiceNotDefined(socialId); + } + + // Claim staking rewards + reward = IStaking(stakingInstance).claim(serviceId); + + emit Claimed(socialId, msg.sender, serviceId, multisig, stakingInstance); + } +} diff --git a/audits/internal1/analysis/contracts/Contributors-flatten.sol b/audits/internal1/analysis/contracts/Contributors-flatten.sol new file mode 100644 index 0000000..5f9c7c5 --- /dev/null +++ b/audits/internal1/analysis/contracts/Contributors-flatten.sol @@ -0,0 +1,219 @@ +// Sources flattened with hardhat v2.22.4 https://hardhat.org + +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.25; + +/// @dev Only `owner` has a privilege, but the `sender` was provided. +/// @param sender Sender address. +/// @param owner Required sender address as an owner. +error OwnerOnly(address sender, address owner); + +/// @dev The contract is already initialized. +error AlreadyInitialized(); + +/// @dev Zero address. +error ZeroAddress(); + +/// @dev Only manager is allowed to have access. +error OnlyManager(address sender, address manager); + +/// @dev Wrong length of two arrays. +/// @param numValues1 Number of values in a first array. +/// @param numValues2 Number of values in a second array. +error WrongArrayLength(uint256 numValues1, uint256 numValues2); + +/// @dev Account is unauthorized. +/// @param account Account address. +error UnauthorizedAccount(address account); + +// Struct for service info +struct ServiceInfo { + // Social Id + uint256 socialId; + // Service Id + uint256 serviceId; + // Corresponding service multisig + address multisig; + // Staking instance address + address stakingInstance; +} + +/// @title Contributors - Smart contract for managing contributors +/// @author Aleksandr Kuperman - +/// @author Andrey Lebedev - +/// @author Tatiana Priemova - +/// @author David Vilela - +contract Contributors { + event ImplementationUpdated(address indexed implementation); + event OwnerUpdated(address indexed owner); + event ManagerUpdated(address indexed manager); + event SetServiceInfoForId(address indexed serviceOwner, uint256 indexed socialId, uint256 indexed serviceId, + address multisig, address stakingInstance); + event SetContributeAgentStatuses(address[] contributeAgents, bool[] statuses); + event MultisigActivityChanged(address indexed senderAgent, address[] multisigs, uint256[] activityChanges); + + // Version number + string public constant VERSION = "1.0.0"; + // Code position in storage is keccak256("CONTRIBUTORS_PROXY") = "0x8f33b4c48c4f3159dc130f2111086160da6c94439c147bd337ecee0aa81518c7" + bytes32 public constant CONTRIBUTORS_PROXY = 0x8f33b4c48c4f3159dc130f2111086160da6c94439c147bd337ecee0aa81518c7; + + // Contract owner + address public owner; + // Service manager contract address + address public manager; + + // Mapping of address => service info + mapping(address => ServiceInfo) public mapSocialIdServiceInfo; + // Mapping of service multisig address => activity + mapping(address => uint256) public mapMutisigActivities; + // Mapping of whitelisted contributor agents + mapping(address => bool) public mapContributeAgents; + + /// @dev Contributors initializer. + /// @param _manager Manager address. + function initialize(address _manager) external{ + // Check for already initialized + if (owner != address(0)) { + revert AlreadyInitialized(); + } + + // Check for zero address + if (_manager == address(0)) { + revert ZeroAddress(); + } + + owner = msg.sender; + manager = _manager; + } + + /// @dev Changes the contributors implementation contract address. + /// @param newImplementation New implementation contract address. + function changeImplementation(address newImplementation) external { + // Check for the ownership + if (msg.sender != owner) { + revert OwnerOnly(msg.sender, owner); + } + + // Check for zero address + if (newImplementation == address(0)) { + revert ZeroAddress(); + } + + // Store the contributors implementation address + assembly { + sstore(CONTRIBUTORS_PROXY, newImplementation) + } + + emit ImplementationUpdated(newImplementation); + } + + /// @dev Changes contract owner address. + /// @param newOwner Address of a new owner. + function changeOwner(address newOwner) external { + // Check for the ownership + if (msg.sender != owner) { + revert OwnerOnly(msg.sender, owner); + } + + // Check for the zero address + if (newOwner == address(0)) { + revert ZeroAddress(); + } + + owner = newOwner; + emit OwnerUpdated(newOwner); + } + + /// @dev Changes contract manager address. + /// @param newManager Address of a new manager. + function changeManager(address newManager) external { + // Check for the ownership + if (msg.sender != owner) { + revert OwnerOnly(msg.sender, owner); + } + + // Check for the zero address + if (newManager == address(0)) { + revert ZeroAddress(); + } + + manager = newManager; + emit ManagerUpdated(newManager); + } + + /// @dev Sets service info for the social id. + /// @param serviceOwner Service owner. + /// @param socialId Social id. + /// @param serviceId Service Id. + /// @param multisig Service multisig address. + /// @param stakingInstance Staking instance address. + function setServiceInfoForId( + address serviceOwner, + uint256 socialId, + uint256 serviceId, + address multisig, + address stakingInstance + ) external { + // Check for manager + if (msg.sender != manager) { + revert OnlyManager(msg.sender, manager); + } + + // Set (or remove) multisig for the corresponding social id + ServiceInfo storage serviceInfo = mapSocialIdServiceInfo[serviceOwner]; + serviceInfo.socialId = socialId; + serviceInfo.serviceId = serviceId; + serviceInfo.multisig = multisig; + serviceInfo.stakingInstance = stakingInstance; + + emit SetServiceInfoForId(serviceOwner, socialId, serviceId, multisig, stakingInstance); + } + + /// @dev Sets contribute agent statues. + /// @param contributeAgents Contribute agent addresses. + /// @param statuses Corresponding whitelisting statues. + function setContributeAgentStatuses(address[] memory contributeAgents, bool[] memory statuses) external { + // Check for the ownership + if (msg.sender != owner) { + revert OwnerOnly(msg.sender, owner); + } + + // Check for array lengths + if (contributeAgents.length != statuses.length) { + revert WrongArrayLength(contributeAgents.length, statuses.length); + } + + // Traverse all contribute agents and statuses + for (uint256 i = 0; i < contributeAgents.length; ++i) { + if (contributeAgents[i] == address(0)) { + revert ZeroAddress(); + } + + mapContributeAgents[contributeAgents[i]] = statuses[i]; + } + + emit SetContributeAgentStatuses(contributeAgents, statuses); + } + + /// @dev Increases multisig activity by the contribute agent. + /// @param multisigs Multisig addresses. + /// @param activityChanges Corresponding activity changes + function increaseActivity(address[] memory multisigs, uint256[] memory activityChanges) external { + // Check for whitelisted contribute agent + if (!mapContributeAgents[msg.sender]) { + revert UnauthorizedAccount(msg.sender); + } + + // Check for array lengths + if (multisigs.length != activityChanges.length) { + revert WrongArrayLength(multisigs.length, activityChanges.length); + } + + // Increase / decrease multisig activity + for (uint256 i = 0; i < multisigs.length; ++i) { + mapMutisigActivities[multisigs[i]] += activityChanges[i]; + } + + emit MultisigActivityChanged(msg.sender, multisigs, activityChanges); + } +} diff --git a/audits/internal1/analysis/contracts/ContributorsProxy-flatten.sol b/audits/internal1/analysis/contracts/ContributorsProxy-flatten.sol new file mode 100644 index 0000000..e58ea2b --- /dev/null +++ b/audits/internal1/analysis/contracts/ContributorsProxy-flatten.sol @@ -0,0 +1,76 @@ +// Sources flattened with hardhat v2.22.4 https://hardhat.org + +// SPDX-License-Identifier: MIT + +// File contracts/contribute/ContributorsProxy.sol + +// Original license: SPDX_License_Identifier: MIT +pragma solidity ^0.8.25; + +/// @dev Zero implementation address. +error ZeroImplementationAddress(); + +/// @dev Zero contributors data. +error ZeroContributorsData(); + +/// @dev Proxy initialization failed. +error InitializationFailed(); + +/* +* This is a Contributors proxy contract. +* Proxy implementation is created based on the Universal Upgradeable Proxy Standard (UUPS) EIP-1822. +* The implementation address must be located in a unique storage slot of the proxy contract. +* The upgrade logic must be located in the implementation contract. +* Special contributors implementation address slot is produced by hashing the "CONTRIBUTORS_PROXY" +* string in order to make the slot unique. +* The fallback() implementation for all the delegatecall-s is inspired by the Gnosis Safe set of contracts. +*/ + +/// @title ContributorsProxy - Smart contract for contributors proxy +/// @author Aleksandr Kuperman - +/// @author Andrey Lebedev - +/// @author Tatiana Priemova - +/// @author David Vilela - +contract ContributorsProxy { + // Code position in storage is keccak256("CONTRIBUTORS_PROXY") = "0x8f33b4c48c4f3159dc130f2111086160da6c94439c147bd337ecee0aa81518c7" + bytes32 public constant CONTRIBUTORS_PROXY = 0x8f33b4c48c4f3159dc130f2111086160da6c94439c147bd337ecee0aa81518c7; + + /// @dev ContributorsProxy constructor. + /// @param implementation Contributors implementation address. + /// @param contributorsData Contributors initialization data. + constructor(address implementation, bytes memory contributorsData) { + // Check for the zero address, since the delegatecall works even with the zero one + if (implementation == address(0)) { + revert ZeroImplementationAddress(); + } + + // Check for the zero data + if (contributorsData.length == 0) { + revert ZeroContributorsData(); + } + + // Store the contributors implementation address + assembly { + sstore(CONTRIBUTORS_PROXY, implementation) + } + // Initialize proxy tokenomics storage + (bool success, ) = implementation.delegatecall(contributorsData); + if (!success) { + revert InitializationFailed(); + } + } + + /// @dev Delegatecall to all the incoming data. + fallback() external { + assembly { + let implementation := sload(CONTRIBUTORS_PROXY) + calldatacopy(0, 0, calldatasize()) + let success := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) + returndatacopy(0, 0, returndatasize()) + if eq(success, 0) { + revert(0, returndatasize()) + } + return(0, returndatasize()) + } + } +} diff --git a/audits/internal1/analysis/contracts/script.sh b/audits/internal1/analysis/contracts/script.sh new file mode 100644 index 0000000..c4d1607 --- /dev/null +++ b/audits/internal1/analysis/contracts/script.sh @@ -0,0 +1,21 @@ +#!/bin/bash + + slither_options=("call-graph" "constructor-calls" "contract-summary" "data-dependency" "function-summary" + "human-summary" "inheritance" "inheritance-graph" "modifiers" "require" "variable-order" "vars-and-auth") + echo -e "\nRunning slither routines ..." + for so in "${slither_options[@]}"; do + echo -e "\t$so" + slither . --print ${so} &> "slither_$so.txt" + done + echo -e "\tfull report" + slither . &> "slither_full.txt" + + # moving generated .dot files to the audit folder + count=`ls -1 *.dot 2>/dev/null | wc -l` + echo -e "\tgenerated $count .dot files" + for _filename in *.dot; do + filename="${_filename%.*}" + cat $_filename | dot -Tpng > slither_$filename.png + done + rm *.dot + diff --git a/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.ContributeActivityChecker.call-graph.png b/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.ContributeActivityChecker.call-graph.png new file mode 100644 index 0000000..5c5c7ec Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.ContributeActivityChecker.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.IContributors.call-graph.png b/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.IContributors.call-graph.png new file mode 100644 index 0000000..2a97ae9 Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.IContributors.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.all_contracts.call-graph.png b/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.all_contracts.call-graph.png new file mode 100644 index 0000000..5fe39e5 Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.all_contracts.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.inheritance-graph.png b/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.inheritance-graph.png new file mode 100644 index 0000000..145be31 Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeActivityChecker-flatten.sol.inheritance-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributeManager-flatten.sol.ContributeManager.call-graph.png b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.ContributeManager.call-graph.png new file mode 100644 index 0000000..c8a42e6 Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.ContributeManager.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IContributors.call-graph.png b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IContributors.call-graph.png new file mode 100644 index 0000000..58ca33b Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IContributors.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IMultisig.call-graph.png b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IMultisig.call-graph.png new file mode 100644 index 0000000..1e2dc5b Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IMultisig.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IService.call-graph.png b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IService.call-graph.png new file mode 100644 index 0000000..ce6fd9b Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IService.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IStaking.call-graph.png b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IStaking.call-graph.png new file mode 100644 index 0000000..27bc232 Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IStaking.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IToken.call-graph.png b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IToken.call-graph.png new file mode 100644 index 0000000..b1ca9b1 Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.IToken.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributeManager-flatten.sol.all_contracts.call-graph.png b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.all_contracts.call-graph.png new file mode 100644 index 0000000..385d995 Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.all_contracts.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributeManager-flatten.sol.inheritance-graph.png b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.inheritance-graph.png new file mode 100644 index 0000000..a50f088 Binary files /dev/null and b/audits/internal1/analysis/slither_ContributeManager-flatten.sol.inheritance-graph.png differ diff --git a/audits/internal1/analysis/slither_Contributors-flatten.sol.Contributors.call-graph.png b/audits/internal1/analysis/slither_Contributors-flatten.sol.Contributors.call-graph.png new file mode 100644 index 0000000..fdca0c9 Binary files /dev/null and b/audits/internal1/analysis/slither_Contributors-flatten.sol.Contributors.call-graph.png differ diff --git a/audits/internal1/analysis/slither_Contributors-flatten.sol.all_contracts.call-graph.png b/audits/internal1/analysis/slither_Contributors-flatten.sol.all_contracts.call-graph.png new file mode 100644 index 0000000..a9a30be Binary files /dev/null and b/audits/internal1/analysis/slither_Contributors-flatten.sol.all_contracts.call-graph.png differ diff --git a/audits/internal1/analysis/slither_Contributors-flatten.sol.inheritance-graph.png b/audits/internal1/analysis/slither_Contributors-flatten.sol.inheritance-graph.png new file mode 100644 index 0000000..f5e0c34 Binary files /dev/null and b/audits/internal1/analysis/slither_Contributors-flatten.sol.inheritance-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributorsProxy-flatten.sol.ContributorsProxy.call-graph.png b/audits/internal1/analysis/slither_ContributorsProxy-flatten.sol.ContributorsProxy.call-graph.png new file mode 100644 index 0000000..038f66d Binary files /dev/null and b/audits/internal1/analysis/slither_ContributorsProxy-flatten.sol.ContributorsProxy.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributorsProxy-flatten.sol.all_contracts.call-graph.png b/audits/internal1/analysis/slither_ContributorsProxy-flatten.sol.all_contracts.call-graph.png new file mode 100644 index 0000000..ce1c5a3 Binary files /dev/null and b/audits/internal1/analysis/slither_ContributorsProxy-flatten.sol.all_contracts.call-graph.png differ diff --git a/audits/internal1/analysis/slither_ContributorsProxy-flatten.sol.inheritance-graph.png b/audits/internal1/analysis/slither_ContributorsProxy-flatten.sol.inheritance-graph.png new file mode 100644 index 0000000..fbc2dcf Binary files /dev/null and b/audits/internal1/analysis/slither_ContributorsProxy-flatten.sol.inheritance-graph.png differ diff --git a/audits/internal1/analysis/slither_call-graph.txt b/audits/internal1/analysis/slither_call-graph.txt new file mode 100644 index 0000000..22dd994 --- /dev/null +++ b/audits/internal1/analysis/slither_call-graph.txt @@ -0,0 +1,27 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers:Call Graph: ./ContributeManager-flatten.sol.all_contracts.call-graph.dot +Call Graph: ./ContributeManager-flatten.sol.IContributors.call-graph.dot +Call Graph: ./ContributeManager-flatten.sol.IService.call-graph.dot +Call Graph: ./ContributeManager-flatten.sol.IStaking.call-graph.dot +Call Graph: ./ContributeManager-flatten.sol.IToken.call-graph.dot +Call Graph: ./ContributeManager-flatten.sol.IMultisig.call-graph.dot +Call Graph: ./ContributeManager-flatten.sol.ContributeManager.call-graph.dot + +INFO:Printers:Call Graph: ./ContributorsProxy-flatten.sol.all_contracts.call-graph.dot +Call Graph: ./ContributorsProxy-flatten.sol.ContributorsProxy.call-graph.dot + +INFO:Printers:Call Graph: ./Contributors-flatten.sol.all_contracts.call-graph.dot +Call Graph: ./Contributors-flatten.sol.Contributors.call-graph.dot + +INFO:Printers:Call Graph: ./ContributeActivityChecker-flatten.sol.all_contracts.call-graph.dot +Call Graph: ./ContributeActivityChecker-flatten.sol.IContributors.call-graph.dot +Call Graph: ./ContributeActivityChecker-flatten.sol.ContributeActivityChecker.call-graph.dot + +INFO:Slither:. analyzed (10 contracts) diff --git a/audits/internal1/analysis/slither_constructor-calls.txt b/audits/internal1/analysis/slither_constructor-calls.txt new file mode 100644 index 0000000..f63c67f --- /dev/null +++ b/audits/internal1/analysis/slither_constructor-calls.txt @@ -0,0 +1,117 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers: +################################# +####### ContributeManager ####### +################################# + +## Constructor Call Sequence + - ContributeManager + +## Constructor Definitions + +### ContributeManager + + constructor( + address _contributorsProxy, + address _serviceManager, + address _olas, + address _stakingFactory, + address _safeMultisig, + address _fallbackHandler, + uint256 _agentId, + bytes32 _configHash + ) { + // Check for zero addresses + if (_contributorsProxy == address(0) || _serviceManager == address(0) || _olas == address(0) || + _stakingFactory == address(0) || _safeMultisig == address(0) || _fallbackHandler == address(0)) { + revert ZeroAddress(); + } + + // Check for zero values + if (_agentId == 0 || _configHash == 0) { + revert ZeroValue(); + } + + agentId = _agentId; + configHash = _configHash; + + contributorsProxy = _contributorsProxy; + serviceManager = _serviceManager; + olas = _olas; + stakingFactory = _stakingFactory; + safeMultisig = _safeMultisig; + fallbackHandler = _fallbackHandler; + serviceRegistry = IService(serviceManager).serviceRegistry(); + serviceRegistryTokenUtility = IService(serviceManager).serviceRegistryTokenUtility(); + } + +INFO:Printers: +################################# +####### ContributorsProxy ####### +################################# + +## Constructor Call Sequence + - ContributorsProxy + +## Constructor Definitions + +### ContributorsProxy + + constructor(address implementation, bytes memory contributorsData) { + // Check for the zero address, since the delegatecall works even with the zero one + if (implementation == address(0)) { + revert ZeroImplementationAddress(); + } + + // Check for the zero data + if (contributorsData.length == 0) { + revert ZeroContributorsData(); + } + + // Store the contributors implementation address + assembly { + sstore(CONTRIBUTORS_PROXY, implementation) + } + // Initialize proxy tokenomics storage + (bool success, ) = implementation.delegatecall(contributorsData); + if (!success) { + revert InitializationFailed(); + } + } + +INFO:Printers: +INFO:Printers: +######################################### +####### ContributeActivityChecker ####### +######################################### + +## Constructor Call Sequence + - ContributeActivityChecker + +## Constructor Definitions + +### ContributeActivityChecker + + constructor(address _contributorsProxy, uint256 _livenessRatio) { + // Check the zero address + if (_contributorsProxy == address(0)) { + revert ZeroAddress(); + } + + // Check for zero value + if (_livenessRatio == 0) { + revert ZeroValue(); + } + + contributorsProxy = _contributorsProxy; + livenessRatio = _livenessRatio; + } + +INFO:Slither:. analyzed (10 contracts) diff --git a/audits/internal1/analysis/slither_contract-summary.txt b/audits/internal1/analysis/slither_contract-summary.txt new file mode 100644 index 0000000..79175e8 --- /dev/null +++ b/audits/internal1/analysis/slither_contract-summary.txt @@ -0,0 +1,84 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers: ++ Contract IContributors (Most derived contract) + - From IContributors + - mapSocialIdServiceInfo(address) (external) + - setServiceInfoForId(address,uint256,uint256,address,address) (external) + ++ Contract IService (Most derived contract) + - From IService + - activateRegistration(uint256) (external) + - create(address,address,bytes32,uint32[],IService.AgentParams[],uint32) (external) + - deploy(uint256,address,bytes) (external) + - mapServices(uint256) (external) + - registerAgents(uint256,address[],uint32[]) (external) + - serviceRegistry() (external) + - serviceRegistryTokenUtility() (external) + ++ Contract IStaking (Most derived contract) + - From IStaking + - claim(uint256) (external) + - minStakingDeposit() (external) + - numAgentInstances() (external) + - stake(uint256) (external) + - stakingToken() (external) + - threshold() (external) + - unstake(uint256) (external) + - verifyInstance(address) (external) + ++ Contract IToken (Most derived contract) + - From IToken + - approve(address,uint256) (external) + - transfer(address,uint256) (external) + - transferFrom(address,address,uint256) (external) + ++ Contract IMultisig (Most derived contract) + - From IMultisig + - getOwners() (external) + ++ Contract ContributeManager (Most derived contract) + - From ContributeManager + - _createAndDeploy(address,uint256) (internal) + - _stake(uint256,uint256,address,address) (internal) + - claim() (external) + - constructor(address,address,address,address,address,address,uint256,bytes32) (public) + - createAndStake(uint256,address) (external) + - stake(uint256,uint256,address) (external) + - unstake() (external) + +INFO:Printers: ++ Contract ContributorsProxy (Upgradeable Proxy) (Most derived contract) + - From ContributorsProxy + - constructor(address,bytes) (public) + - fallback() (external) + +INFO:Printers: ++ Contract Contributors (Most derived contract) + - From Contributors + - changeImplementation(address) (external) + - changeManager(address) (external) + - changeOwner(address) (external) + - increaseActivity(address[],uint256[]) (external) + - initialize(address) (external) + - setContributeAgentStatuses(address[],bool[]) (external) + - setServiceInfoForId(address,uint256,uint256,address,address) (external) + +INFO:Printers: ++ Contract IContributors (Most derived contract) + - From IContributors + - mapMutisigActivities(address) (external) + ++ Contract ContributeActivityChecker (Most derived contract) + - From ContributeActivityChecker + - constructor(address,uint256) (public) + - getMultisigNonces(address) (external) + - isRatioPass(uint256[],uint256[],uint256) (external) + +INFO:Slither:. analyzed (10 contracts) diff --git a/audits/internal1/analysis/slither_data-dependency.txt b/audits/internal1/analysis/slither_data-dependency.txt new file mode 100644 index 0000000..9c2cc40 --- /dev/null +++ b/audits/internal1/analysis/slither_data-dependency.txt @@ -0,0 +1,1287 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers: +Contract IContributors ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function setServiceInfoForId(address,uint256,uint256,address,address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +Function mapSocialIdServiceInfo(address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +INFO:Printers: +Contract IContributors ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function setServiceInfoForId(address,uint256,uint256,address,address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +Function mapSocialIdServiceInfo(address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +Contract IService ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function create(address,address,bytes32,uint32[],IService.AgentParams[],uint32) ++--------------+--------------+ +| Variable | Dependencies | ++--------------+--------------+ +| serviceOwner | [] | +| token | [] | +| configHash | [] | +| agentIds | [] | +| agentParams | [] | +| threshold | [] | +| serviceId | [] | ++--------------+--------------+ +Function activateRegistration(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| success | [] | ++-----------+--------------+ +Function registerAgents(uint256,address[],uint32[]) ++----------------+--------------+ +| Variable | Dependencies | ++----------------+--------------+ +| serviceId | [] | +| agentInstances | [] | +| agentIds | [] | +| success | [] | ++----------------+--------------+ +Function deploy(uint256,address,bytes) ++------------------------+--------------+ +| Variable | Dependencies | ++------------------------+--------------+ +| serviceId | [] | +| multisigImplementation | [] | +| data | [] | +| multisig | [] | ++------------------------+--------------+ +Function serviceRegistry() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function serviceRegistryTokenUtility() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function mapServices(uint256) ++----------------------+--------------+ +| Variable | Dependencies | ++----------------------+--------------+ +| serviceId | [] | +| securityDeposit | [] | +| multisig | [] | +| configHash | [] | +| threshold | [] | +| maxNumAgentInstances | [] | +| numAgentInstances | [] | +| state | [] | ++----------------------+--------------+ +INFO:Printers: +Contract IContributors ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function setServiceInfoForId(address,uint256,uint256,address,address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +Function mapSocialIdServiceInfo(address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +Contract IService ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function create(address,address,bytes32,uint32[],IService.AgentParams[],uint32) ++--------------+--------------+ +| Variable | Dependencies | ++--------------+--------------+ +| serviceOwner | [] | +| token | [] | +| configHash | [] | +| agentIds | [] | +| agentParams | [] | +| threshold | [] | +| serviceId | [] | ++--------------+--------------+ +Function activateRegistration(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| success | [] | ++-----------+--------------+ +Function registerAgents(uint256,address[],uint32[]) ++----------------+--------------+ +| Variable | Dependencies | ++----------------+--------------+ +| serviceId | [] | +| agentInstances | [] | +| agentIds | [] | +| success | [] | ++----------------+--------------+ +Function deploy(uint256,address,bytes) ++------------------------+--------------+ +| Variable | Dependencies | ++------------------------+--------------+ +| serviceId | [] | +| multisigImplementation | [] | +| data | [] | +| multisig | [] | ++------------------------+--------------+ +Function serviceRegistry() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function serviceRegistryTokenUtility() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function mapServices(uint256) ++----------------------+--------------+ +| Variable | Dependencies | ++----------------------+--------------+ +| serviceId | [] | +| securityDeposit | [] | +| multisig | [] | +| configHash | [] | +| threshold | [] | +| maxNumAgentInstances | [] | +| numAgentInstances | [] | +| state | [] | ++----------------------+--------------+ +Contract IStaking ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function stakingToken() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function minStakingDeposit() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function numAgentInstances() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function threshold() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function stake(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | ++-----------+--------------+ +Function unstake(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| | [] | ++-----------+--------------+ +Function claim(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| | [] | ++-----------+--------------+ +Function verifyInstance(address) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| instance | [] | +| | [] | ++----------+--------------+ +INFO:Printers: +Contract IContributors ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function setServiceInfoForId(address,uint256,uint256,address,address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +Function mapSocialIdServiceInfo(address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +Contract IService ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function create(address,address,bytes32,uint32[],IService.AgentParams[],uint32) ++--------------+--------------+ +| Variable | Dependencies | ++--------------+--------------+ +| serviceOwner | [] | +| token | [] | +| configHash | [] | +| agentIds | [] | +| agentParams | [] | +| threshold | [] | +| serviceId | [] | ++--------------+--------------+ +Function activateRegistration(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| success | [] | ++-----------+--------------+ +Function registerAgents(uint256,address[],uint32[]) ++----------------+--------------+ +| Variable | Dependencies | ++----------------+--------------+ +| serviceId | [] | +| agentInstances | [] | +| agentIds | [] | +| success | [] | ++----------------+--------------+ +Function deploy(uint256,address,bytes) ++------------------------+--------------+ +| Variable | Dependencies | ++------------------------+--------------+ +| serviceId | [] | +| multisigImplementation | [] | +| data | [] | +| multisig | [] | ++------------------------+--------------+ +Function serviceRegistry() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function serviceRegistryTokenUtility() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function mapServices(uint256) ++----------------------+--------------+ +| Variable | Dependencies | ++----------------------+--------------+ +| serviceId | [] | +| securityDeposit | [] | +| multisig | [] | +| configHash | [] | +| threshold | [] | +| maxNumAgentInstances | [] | +| numAgentInstances | [] | +| state | [] | ++----------------------+--------------+ +Contract IStaking ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function stakingToken() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function minStakingDeposit() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function numAgentInstances() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function threshold() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function stake(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | ++-----------+--------------+ +Function unstake(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| | [] | ++-----------+--------------+ +Function claim(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| | [] | ++-----------+--------------+ +Function verifyInstance(address) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| instance | [] | +| | [] | ++----------+--------------+ +Contract IToken ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function transfer(address,uint256) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| to | [] | +| amount | [] | +| | [] | ++----------+--------------+ +Function transferFrom(address,address,uint256) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| from | [] | +| to | [] | +| amount | [] | +| | [] | ++----------+--------------+ +Function approve(address,uint256) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| spender | [] | +| amount | [] | +| | [] | ++----------+--------------+ +INFO:Printers: +Contract IContributors ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function setServiceInfoForId(address,uint256,uint256,address,address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +Function mapSocialIdServiceInfo(address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +Contract IService ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function create(address,address,bytes32,uint32[],IService.AgentParams[],uint32) ++--------------+--------------+ +| Variable | Dependencies | ++--------------+--------------+ +| serviceOwner | [] | +| token | [] | +| configHash | [] | +| agentIds | [] | +| agentParams | [] | +| threshold | [] | +| serviceId | [] | ++--------------+--------------+ +Function activateRegistration(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| success | [] | ++-----------+--------------+ +Function registerAgents(uint256,address[],uint32[]) ++----------------+--------------+ +| Variable | Dependencies | ++----------------+--------------+ +| serviceId | [] | +| agentInstances | [] | +| agentIds | [] | +| success | [] | ++----------------+--------------+ +Function deploy(uint256,address,bytes) ++------------------------+--------------+ +| Variable | Dependencies | ++------------------------+--------------+ +| serviceId | [] | +| multisigImplementation | [] | +| data | [] | +| multisig | [] | ++------------------------+--------------+ +Function serviceRegistry() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function serviceRegistryTokenUtility() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function mapServices(uint256) ++----------------------+--------------+ +| Variable | Dependencies | ++----------------------+--------------+ +| serviceId | [] | +| securityDeposit | [] | +| multisig | [] | +| configHash | [] | +| threshold | [] | +| maxNumAgentInstances | [] | +| numAgentInstances | [] | +| state | [] | ++----------------------+--------------+ +Contract IStaking ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function stakingToken() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function minStakingDeposit() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function numAgentInstances() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function threshold() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function stake(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | ++-----------+--------------+ +Function unstake(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| | [] | ++-----------+--------------+ +Function claim(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| | [] | ++-----------+--------------+ +Function verifyInstance(address) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| instance | [] | +| | [] | ++----------+--------------+ +Contract IToken ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function transfer(address,uint256) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| to | [] | +| amount | [] | +| | [] | ++----------+--------------+ +Function transferFrom(address,address,uint256) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| from | [] | +| to | [] | +| amount | [] | +| | [] | ++----------+--------------+ +Function approve(address,uint256) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| spender | [] | +| amount | [] | +| | [] | ++----------+--------------+ +Contract IMultisig ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function getOwners() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +INFO:Printers: +Contract IContributors ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function setServiceInfoForId(address,uint256,uint256,address,address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +Function mapSocialIdServiceInfo(address) ++-----------------+--------------+ +| Variable | Dependencies | ++-----------------+--------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | ++-----------------+--------------+ +Contract IService ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function create(address,address,bytes32,uint32[],IService.AgentParams[],uint32) ++--------------+--------------+ +| Variable | Dependencies | ++--------------+--------------+ +| serviceOwner | [] | +| token | [] | +| configHash | [] | +| agentIds | [] | +| agentParams | [] | +| threshold | [] | +| serviceId | [] | ++--------------+--------------+ +Function activateRegistration(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| success | [] | ++-----------+--------------+ +Function registerAgents(uint256,address[],uint32[]) ++----------------+--------------+ +| Variable | Dependencies | ++----------------+--------------+ +| serviceId | [] | +| agentInstances | [] | +| agentIds | [] | +| success | [] | ++----------------+--------------+ +Function deploy(uint256,address,bytes) ++------------------------+--------------+ +| Variable | Dependencies | ++------------------------+--------------+ +| serviceId | [] | +| multisigImplementation | [] | +| data | [] | +| multisig | [] | ++------------------------+--------------+ +Function serviceRegistry() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function serviceRegistryTokenUtility() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function mapServices(uint256) ++----------------------+--------------+ +| Variable | Dependencies | ++----------------------+--------------+ +| serviceId | [] | +| securityDeposit | [] | +| multisig | [] | +| configHash | [] | +| threshold | [] | +| maxNumAgentInstances | [] | +| numAgentInstances | [] | +| state | [] | ++----------------------+--------------+ +Contract IStaking ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function stakingToken() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function minStakingDeposit() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function numAgentInstances() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function threshold() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Function stake(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | ++-----------+--------------+ +Function unstake(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| | [] | ++-----------+--------------+ +Function claim(uint256) ++-----------+--------------+ +| Variable | Dependencies | ++-----------+--------------+ +| serviceId | [] | +| | [] | ++-----------+--------------+ +Function verifyInstance(address) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| instance | [] | +| | [] | ++----------+--------------+ +Contract IToken ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function transfer(address,uint256) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| to | [] | +| amount | [] | +| | [] | ++----------+--------------+ +Function transferFrom(address,address,uint256) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| from | [] | +| to | [] | +| amount | [] | +| | [] | ++----------+--------------+ +Function approve(address,uint256) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| spender | [] | +| amount | [] | +| | [] | ++----------+--------------+ +Contract IMultisig ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function getOwners() ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| | [] | ++----------+--------------+ +Contract ContributeManager ++-----------------------------+----------------------------------------------------------------------+ +| Variable | Dependencies | ++-----------------------------+----------------------------------------------------------------------+ +| NUM_AGENT_INSTANCES | ['NUM_AGENT_INSTANCES'] | +| THRESHOLD | ['THRESHOLD'] | +| agentId | ['_agentId', 'agentId'] | +| configHash | ['_configHash', 'configHash'] | +| contributorsProxy | ['_contributorsProxy', 'contributorsProxy'] | +| serviceManager | ['_serviceManager', 'serviceManager'] | +| olas | ['_olas', 'olas'] | +| serviceRegistry | ['_serviceManager', 'serviceManager', 'serviceRegistry'] | +| serviceRegistryTokenUtility | ['_serviceManager', 'serviceManager', 'serviceRegistryTokenUtility'] | +| stakingFactory | ['_stakingFactory', 'stakingFactory'] | +| safeMultisig | ['_safeMultisig', 'safeMultisig'] | +| fallbackHandler | ['_fallbackHandler', 'fallbackHandler'] | +| nonce | ['localNonce', 'nonce'] | ++-----------------------------+----------------------------------------------------------------------+ + +Function constructor(address,address,address,address,address,address,uint256,bytes32) ++-----------------------------------------------+---------------------------------------+ +| Variable | Dependencies | ++-----------------------------------------------+---------------------------------------+ +| _contributorsProxy | [] | +| _serviceManager | [] | +| _olas | [] | +| _stakingFactory | [] | +| _safeMultisig | [] | +| _fallbackHandler | [] | +| _agentId | [] | +| _configHash | [] | +| ContributeManager.NUM_AGENT_INSTANCES | [] | +| ContributeManager.THRESHOLD | [] | +| ContributeManager.agentId | ['_agentId'] | +| ContributeManager.configHash | ['_configHash'] | +| ContributeManager.contributorsProxy | ['_contributorsProxy'] | +| ContributeManager.serviceManager | ['_serviceManager', 'serviceManager'] | +| ContributeManager.olas | ['_olas'] | +| ContributeManager.serviceRegistry | ['_serviceManager', 'serviceManager'] | +| ContributeManager.serviceRegistryTokenUtility | ['_serviceManager', 'serviceManager'] | +| ContributeManager.stakingFactory | ['_stakingFactory'] | +| ContributeManager.safeMultisig | ['_safeMultisig'] | +| ContributeManager.fallbackHandler | ['_fallbackHandler'] | +| ContributeManager.nonce | [] | ++-----------------------------------------------+---------------------------------------+ +Function _createAndDeploy(address,uint256) ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| Variable | Dependencies | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| token | ['olas'] | +| minStakingDeposit | ['minStakingDeposit'] | +| serviceId | ['NUM_AGENT_INSTANCES', 'THRESHOLD', 'agentId', 'agentIds', 'agentParams', 'configHash', 'minStakingDeposit', 'olas', 'serviceManager', 'this', 'token'] | +| multisig | ['NUM_AGENT_INSTANCES', 'THRESHOLD', 'agentId', 'agentIds', 'agentParams', 'block.timestamp', 'configHash', 'data', 'fallbackHandler', 'localNonce', 'minStakingDeposit', 'msg.sender', 'nonce', 'olas', 'randomNonce', 'safeMultisig', 'serviceId', 'serviceManager', 'this', 'token'] | +| agentParams | ['NUM_AGENT_INSTANCES', 'agentParams', 'minStakingDeposit'] | +| agentIds | ['NUM_AGENT_INSTANCES', 'agentId', 'agentIds'] | +| instances | ['NUM_AGENT_INSTANCES', 'instances', 'msg.sender'] | +| localNonce | ['nonce'] | +| randomNonce | ['block.timestamp', 'localNonce', 'msg.sender', 'nonce'] | +| data | ['block.timestamp', 'fallbackHandler', 'localNonce', 'msg.sender', 'nonce', 'randomNonce'] | +| ContributeManager.NUM_AGENT_INSTANCES | ['NUM_AGENT_INSTANCES'] | +| ContributeManager.THRESHOLD | ['THRESHOLD'] | +| ContributeManager.agentId | ['agentId'] | +| ContributeManager.configHash | ['configHash'] | +| ContributeManager.contributorsProxy | [] | +| ContributeManager.serviceManager | ['serviceManager'] | +| ContributeManager.olas | [] | +| ContributeManager.serviceRegistry | [] | +| ContributeManager.serviceRegistryTokenUtility | [] | +| ContributeManager.stakingFactory | [] | +| ContributeManager.safeMultisig | ['safeMultisig'] | +| ContributeManager.fallbackHandler | ['fallbackHandler'] | +| ContributeManager.nonce | ['localNonce', 'nonce'] | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +Function _stake(uint256,uint256,address,address) ++-----------------------------------------------+-----------------------+ +| Variable | Dependencies | ++-----------------------------------------------+-----------------------+ +| socialId | ['socialId'] | +| serviceId | ['serviceId'] | +| multisig | ['multisig'] | +| stakingInstance | ['stakingInstance'] | +| ContributeManager.NUM_AGENT_INSTANCES | [] | +| ContributeManager.THRESHOLD | [] | +| ContributeManager.agentId | [] | +| ContributeManager.configHash | [] | +| ContributeManager.contributorsProxy | ['contributorsProxy'] | +| ContributeManager.serviceManager | [] | +| ContributeManager.olas | [] | +| ContributeManager.serviceRegistry | ['serviceRegistry'] | +| ContributeManager.serviceRegistryTokenUtility | [] | +| ContributeManager.stakingFactory | [] | +| ContributeManager.safeMultisig | [] | +| ContributeManager.fallbackHandler | [] | +| ContributeManager.nonce | [] | ++-----------------------------------------------+-----------------------+ +Function createAndStake(uint256,address) ++-----------------------------------------------+-----------------------------------------------------------------+ +| Variable | Dependencies | ++-----------------------------------------------+-----------------------------------------------------------------+ +| socialId | [] | +| stakingInstance | [] | +| serviceId | ['TUPLE_0', 'TUPLE_1', 'contributorsProxy', 'msg.sender'] | +| multisig | ['TUPLE_0', 'TUPLE_1', 'contributorsProxy', 'msg.sender'] | +| token | ['stakingInstance'] | +| minStakingDeposit | ['stakingInstance'] | +| numAgentInstances | ['stakingInstance'] | +| threshold | ['stakingInstance'] | +| totalBond | ['NUM_AGENT_INSTANCES', 'minStakingDeposit', 'stakingInstance'] | +| ContributeManager.NUM_AGENT_INSTANCES | ['NUM_AGENT_INSTANCES'] | +| ContributeManager.THRESHOLD | ['THRESHOLD'] | +| ContributeManager.agentId | [] | +| ContributeManager.configHash | [] | +| ContributeManager.contributorsProxy | ['contributorsProxy'] | +| ContributeManager.serviceManager | [] | +| ContributeManager.olas | ['olas'] | +| ContributeManager.serviceRegistry | [] | +| ContributeManager.serviceRegistryTokenUtility | ['serviceRegistryTokenUtility'] | +| ContributeManager.stakingFactory | ['stakingFactory'] | +| ContributeManager.safeMultisig | [] | +| ContributeManager.fallbackHandler | [] | +| ContributeManager.nonce | [] | ++-----------------------------------------------+-----------------------------------------------------------------+ +Function stake(uint256,uint256,address) ++-----------------------------------------------+-------------------------------------------------------------------------------------------+ +| Variable | Dependencies | ++-----------------------------------------------+-------------------------------------------------------------------------------------------+ +| socialId | [] | +| serviceId | [] | +| stakingInstance | [] | +| serviceIdCheck | ['TUPLE_2', 'contributorsProxy', 'msg.sender'] | +| multisig | ['TUPLE_2', 'TUPLE_3', 'contributorsProxy', 'msg.sender', 'serviceId', 'serviceRegistry'] | +| numAgentInstances | ['stakingInstance'] | +| multisigOwners | ['TUPLE_3', 'multisig', 'multisigOwners', 'serviceId', 'serviceRegistry'] | +| ContributeManager.NUM_AGENT_INSTANCES | [] | +| ContributeManager.THRESHOLD | [] | +| ContributeManager.agentId | [] | +| ContributeManager.configHash | [] | +| ContributeManager.contributorsProxy | ['contributorsProxy'] | +| ContributeManager.serviceManager | [] | +| ContributeManager.olas | [] | +| ContributeManager.serviceRegistry | ['serviceRegistry'] | +| ContributeManager.serviceRegistryTokenUtility | [] | +| ContributeManager.stakingFactory | [] | +| ContributeManager.safeMultisig | [] | +| ContributeManager.fallbackHandler | [] | +| ContributeManager.nonce | [] | ++-----------------------------------------------+-------------------------------------------------------------------------------------------+ +Function unstake() ++-----------------------------------------------+------------------------------------------------+ +| Variable | Dependencies | ++-----------------------------------------------+------------------------------------------------+ +| socialId | ['TUPLE_4', 'contributorsProxy', 'msg.sender'] | +| serviceId | ['TUPLE_4', 'contributorsProxy', 'msg.sender'] | +| multisig | ['TUPLE_4', 'contributorsProxy', 'msg.sender'] | +| stakingInstance | ['TUPLE_4', 'contributorsProxy', 'msg.sender'] | +| ContributeManager.NUM_AGENT_INSTANCES | [] | +| ContributeManager.THRESHOLD | [] | +| ContributeManager.agentId | [] | +| ContributeManager.configHash | [] | +| ContributeManager.contributorsProxy | ['contributorsProxy'] | +| ContributeManager.serviceManager | [] | +| ContributeManager.olas | [] | +| ContributeManager.serviceRegistry | ['serviceRegistry'] | +| ContributeManager.serviceRegistryTokenUtility | [] | +| ContributeManager.stakingFactory | [] | +| ContributeManager.safeMultisig | [] | +| ContributeManager.fallbackHandler | [] | +| ContributeManager.nonce | [] | ++-----------------------------------------------+------------------------------------------------+ +Function claim() ++-----------------------------------------------+--------------------------------------------------------------------------------+ +| Variable | Dependencies | ++-----------------------------------------------+--------------------------------------------------------------------------------+ +| reward | ['TUPLE_5', 'contributorsProxy', 'msg.sender', 'serviceId', 'stakingInstance'] | +| socialId | ['TUPLE_5', 'contributorsProxy', 'msg.sender'] | +| serviceId | ['TUPLE_5', 'contributorsProxy', 'msg.sender'] | +| multisig | ['TUPLE_5', 'contributorsProxy', 'msg.sender'] | +| stakingInstance | ['TUPLE_5', 'contributorsProxy', 'msg.sender'] | +| ContributeManager.NUM_AGENT_INSTANCES | [] | +| ContributeManager.THRESHOLD | [] | +| ContributeManager.agentId | [] | +| ContributeManager.configHash | [] | +| ContributeManager.contributorsProxy | ['contributorsProxy'] | +| ContributeManager.serviceManager | [] | +| ContributeManager.olas | [] | +| ContributeManager.serviceRegistry | [] | +| ContributeManager.serviceRegistryTokenUtility | [] | +| ContributeManager.stakingFactory | [] | +| ContributeManager.safeMultisig | [] | +| ContributeManager.fallbackHandler | [] | +| ContributeManager.nonce | [] | ++-----------------------------------------------+--------------------------------------------------------------------------------+ +Function slitherConstructorConstantVariables() ++-----------------------------------------------+--------------+ +| Variable | Dependencies | ++-----------------------------------------------+--------------+ +| ContributeManager.NUM_AGENT_INSTANCES | [] | +| ContributeManager.THRESHOLD | [] | +| ContributeManager.agentId | [] | +| ContributeManager.configHash | [] | +| ContributeManager.contributorsProxy | [] | +| ContributeManager.serviceManager | [] | +| ContributeManager.olas | [] | +| ContributeManager.serviceRegistry | [] | +| ContributeManager.serviceRegistryTokenUtility | [] | +| ContributeManager.stakingFactory | [] | +| ContributeManager.safeMultisig | [] | +| ContributeManager.fallbackHandler | [] | +| ContributeManager.nonce | [] | ++-----------------------------------------------+--------------+ +INFO:Printers: +Contract ContributorsProxy ++--------------------+------------------------+ +| Variable | Dependencies | ++--------------------+------------------------+ +| CONTRIBUTORS_PROXY | ['CONTRIBUTORS_PROXY'] | ++--------------------+------------------------+ + +Function constructor(address,bytes) ++--------------------------------------+---------------------------------------------------+ +| Variable | Dependencies | ++--------------------------------------+---------------------------------------------------+ +| implementation | [] | +| contributorsData | ['contributorsData'] | +| success | ['TUPLE_0', 'contributorsData', 'implementation'] | +| ContributorsProxy.CONTRIBUTORS_PROXY | ['CONTRIBUTORS_PROXY'] | ++--------------------------------------+---------------------------------------------------+ +Function fallback() ++--------------------------------------+------------------------+ +| Variable | Dependencies | ++--------------------------------------+------------------------+ +| ContributorsProxy.CONTRIBUTORS_PROXY | ['CONTRIBUTORS_PROXY'] | ++--------------------------------------+------------------------+ +Function slitherConstructorConstantVariables() ++--------------------------------------+--------------+ +| Variable | Dependencies | ++--------------------------------------+--------------+ +| ContributorsProxy.CONTRIBUTORS_PROXY | [] | ++--------------------------------------+--------------+ +INFO:Printers: +Contract Contributors ++------------------------+---------------------------------------------------------------------------------------------------+ +| Variable | Dependencies | ++------------------------+---------------------------------------------------------------------------------------------------+ +| VERSION | [] | +| CONTRIBUTORS_PROXY | ['CONTRIBUTORS_PROXY'] | +| owner | ['msg.sender', 'newOwner', 'owner'] | +| manager | ['_manager', 'manager', 'newManager'] | +| mapSocialIdServiceInfo | ['mapSocialIdServiceInfo', 'multisig', 'serviceId', 'serviceInfo', 'socialId', 'stakingInstance'] | +| mapMutisigActivities | ['activityChanges', 'mapMutisigActivities'] | +| mapContributeAgents | ['mapContributeAgents', 'statuses'] | ++------------------------+---------------------------------------------------------------------------------------------------+ + +Function initialize(address) ++-------------------------------------+-------------------------+ +| Variable | Dependencies | ++-------------------------------------+-------------------------+ +| _manager | [] | +| Contributors.VERSION | [] | +| Contributors.CONTRIBUTORS_PROXY | [] | +| Contributors.owner | ['msg.sender', 'owner'] | +| Contributors.manager | ['_manager'] | +| Contributors.mapSocialIdServiceInfo | [] | +| Contributors.mapMutisigActivities | [] | +| Contributors.mapContributeAgents | [] | ++-------------------------------------+-------------------------+ +Function changeImplementation(address) ++-------------------------------------+------------------------+ +| Variable | Dependencies | ++-------------------------------------+------------------------+ +| newImplementation | [] | +| Contributors.VERSION | [] | +| Contributors.CONTRIBUTORS_PROXY | ['CONTRIBUTORS_PROXY'] | +| Contributors.owner | ['owner'] | +| Contributors.manager | [] | +| Contributors.mapSocialIdServiceInfo | [] | +| Contributors.mapMutisigActivities | [] | +| Contributors.mapContributeAgents | [] | ++-------------------------------------+------------------------+ +Function changeOwner(address) ++-------------------------------------+-----------------------+ +| Variable | Dependencies | ++-------------------------------------+-----------------------+ +| newOwner | [] | +| Contributors.VERSION | [] | +| Contributors.CONTRIBUTORS_PROXY | [] | +| Contributors.owner | ['newOwner', 'owner'] | +| Contributors.manager | [] | +| Contributors.mapSocialIdServiceInfo | [] | +| Contributors.mapMutisigActivities | [] | +| Contributors.mapContributeAgents | [] | ++-------------------------------------+-----------------------+ +Function changeManager(address) ++-------------------------------------+----------------+ +| Variable | Dependencies | ++-------------------------------------+----------------+ +| newManager | [] | +| Contributors.VERSION | [] | +| Contributors.CONTRIBUTORS_PROXY | [] | +| Contributors.owner | ['owner'] | +| Contributors.manager | ['newManager'] | +| Contributors.mapSocialIdServiceInfo | [] | +| Contributors.mapMutisigActivities | [] | +| Contributors.mapContributeAgents | [] | ++-------------------------------------+----------------+ +Function setServiceInfoForId(address,uint256,uint256,address,address) ++-------------------------------------+---------------------------------------------------------------------------------------------------+ +| Variable | Dependencies | ++-------------------------------------+---------------------------------------------------------------------------------------------------+ +| serviceOwner | [] | +| socialId | [] | +| serviceId | [] | +| multisig | [] | +| stakingInstance | [] | +| serviceInfo | ['multisig', 'serviceId', 'serviceInfo', 'socialId', 'stakingInstance'] | +| Contributors.VERSION | [] | +| Contributors.CONTRIBUTORS_PROXY | [] | +| Contributors.owner | [] | +| Contributors.manager | ['manager'] | +| Contributors.mapSocialIdServiceInfo | ['mapSocialIdServiceInfo', 'multisig', 'serviceId', 'serviceInfo', 'socialId', 'stakingInstance'] | +| Contributors.mapMutisigActivities | [] | +| Contributors.mapContributeAgents | [] | ++-------------------------------------+---------------------------------------------------------------------------------------------------+ +Function setContributeAgentStatuses(address[],bool[]) ++-------------------------------------+-------------------------------------+ +| Variable | Dependencies | ++-------------------------------------+-------------------------------------+ +| contributeAgents | ['contributeAgents'] | +| statuses | ['statuses'] | +| i | ['i'] | +| Contributors.VERSION | [] | +| Contributors.CONTRIBUTORS_PROXY | [] | +| Contributors.owner | ['owner'] | +| Contributors.manager | [] | +| Contributors.mapSocialIdServiceInfo | [] | +| Contributors.mapMutisigActivities | [] | +| Contributors.mapContributeAgents | ['mapContributeAgents', 'statuses'] | ++-------------------------------------+-------------------------------------+ +Function increaseActivity(address[],uint256[]) ++-------------------------------------+---------------------------------------------+ +| Variable | Dependencies | ++-------------------------------------+---------------------------------------------+ +| multisigs | ['multisigs'] | +| activityChanges | ['activityChanges'] | +| i | ['i'] | +| Contributors.VERSION | [] | +| Contributors.CONTRIBUTORS_PROXY | [] | +| Contributors.owner | [] | +| Contributors.manager | [] | +| Contributors.mapSocialIdServiceInfo | [] | +| Contributors.mapMutisigActivities | ['activityChanges', 'mapMutisigActivities'] | +| Contributors.mapContributeAgents | ['mapContributeAgents'] | ++-------------------------------------+---------------------------------------------+ +Function slitherConstructorConstantVariables() ++-------------------------------------+--------------+ +| Variable | Dependencies | ++-------------------------------------+--------------+ +| Contributors.VERSION | [] | +| Contributors.CONTRIBUTORS_PROXY | [] | +| Contributors.owner | [] | +| Contributors.manager | [] | +| Contributors.mapSocialIdServiceInfo | [] | +| Contributors.mapMutisigActivities | [] | +| Contributors.mapContributeAgents | [] | ++-------------------------------------+--------------+ +INFO:Printers: +Contract IContributors ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function mapMutisigActivities(address) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| multisig | [] | +| | [] | ++----------+--------------+ +INFO:Printers: +Contract IContributors ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ ++----------+--------------+ + +Function mapMutisigActivities(address) ++----------+--------------+ +| Variable | Dependencies | ++----------+--------------+ +| multisig | [] | +| | [] | ++----------+--------------+ +Contract ContributeActivityChecker ++-------------------+---------------------------------------------+ +| Variable | Dependencies | ++-------------------+---------------------------------------------+ +| livenessRatio | ['_livenessRatio', 'livenessRatio'] | +| contributorsProxy | ['_contributorsProxy', 'contributorsProxy'] | ++-------------------+---------------------------------------------+ + +Function constructor(address,uint256) ++---------------------------------------------+------------------------+ +| Variable | Dependencies | ++---------------------------------------------+------------------------+ +| _contributorsProxy | [] | +| _livenessRatio | [] | +| ContributeActivityChecker.livenessRatio | ['_livenessRatio'] | +| ContributeActivityChecker.contributorsProxy | ['_contributorsProxy'] | ++---------------------------------------------+------------------------+ +Function getMultisigNonces(address) ++---------------------------------------------+---------------------------------------------+ +| Variable | Dependencies | ++---------------------------------------------+---------------------------------------------+ +| multisig | [] | +| nonces | ['contributorsProxy', 'multisig', 'nonces'] | +| ContributeActivityChecker.livenessRatio | [] | +| ContributeActivityChecker.contributorsProxy | ['contributorsProxy'] | ++---------------------------------------------+---------------------------------------------+ +Function isRatioPass(uint256[],uint256[],uint256) ++---------------------------------------------+-------------------------------------------------------------+ +| Variable | Dependencies | ++---------------------------------------------+-------------------------------------------------------------+ +| curNonces | ['curNonces'] | +| lastNonces | ['lastNonces'] | +| ts | [] | +| ratioPass | ['curNonces', 'lastNonces', 'livenessRatio', 'ratio', 'ts'] | +| ratio | ['curNonces', 'lastNonces', 'ts'] | +| ContributeActivityChecker.livenessRatio | ['livenessRatio'] | +| ContributeActivityChecker.contributorsProxy | [] | ++---------------------------------------------+-------------------------------------------------------------+ +INFO:Slither:. analyzed (10 contracts) diff --git a/audits/internal1/analysis/slither_full.txt b/audits/internal1/analysis/slither_full.txt new file mode 100644 index 0000000..e7432ba --- /dev/null +++ b/audits/internal1/analysis/slither_full.txt @@ -0,0 +1,33 @@ + + +Reentrancy in ContributeManager.createAndStake(uint256,address) (ContributeManager-flatten.sol#361-411): + External calls: + - IToken(olas).transferFrom(msg.sender,address(this),totalBond) (ContributeManager-flatten.sol#400) + - IToken(olas).approve(serviceRegistryTokenUtility,totalBond) (ContributeManager-flatten.sol#402) + - (serviceId,multisig) = _createAndDeploy(olas,minStakingDeposit) (ContributeManager-flatten.sol#405) + - serviceId = IService(serviceManager).create(address(this),token,configHash,agentIds,agentParams,uint32(THRESHOLD)) (ContributeManager-flatten.sol#320-321) + - IService(serviceManager).activateRegistration{value: 1}(serviceId) (ContributeManager-flatten.sol#324) + - IService(serviceManager).registerAgents{value: NUM_AGENT_INSTANCES}(serviceId,instances,agentIds) (ContributeManager-flatten.sol#327) + - multisig = IService(serviceManager).deploy(serviceId,safeMultisig,data) (ContributeManager-flatten.sol#335) + - _stake(socialId,serviceId,multisig,stakingInstance) (ContributeManager-flatten.sol#408) + - IContributors(contributorsProxy).setServiceInfoForId(msg.sender,socialId,serviceId,multisig,stakingInstance) (ContributeManager-flatten.sol#348) + - IToken(serviceRegistry).approve(stakingInstance,serviceId) (ContributeManager-flatten.sol#351) + - IStaking(stakingInstance).stake(serviceId) (ContributeManager-flatten.sol#354) + External calls sending eth: + - (serviceId,multisig) = _createAndDeploy(olas,minStakingDeposit) (ContributeManager-flatten.sol#405) + - IService(serviceManager).activateRegistration{value: 1}(serviceId) (ContributeManager-flatten.sol#324) + - IService(serviceManager).registerAgents{value: NUM_AGENT_INSTANCES}(serviceId,instances,agentIds) (ContributeManager-flatten.sol#327) + Event emitted after the call(s): + - CreatedAndStaked(socialId,msg.sender,serviceId,multisig,stakingInstance) (ContributeManager-flatten.sol#410) + +Reentrancy in ContributeManager.unstake() (ContributeManager-flatten.sol#444-463): + External calls: + - IStaking(stakingInstance).unstake(serviceId) (ContributeManager-flatten.sol#453) + - IToken(serviceRegistry).transfer(msg.sender,serviceId) (ContributeManager-flatten.sol#456) + - IContributors(contributorsProxy).setServiceInfoForId(msg.sender,0,0,address(0),address(0)) (ContributeManager-flatten.sol#460) + Event emitted after the call(s): + - Unstaked(socialId,msg.sender,serviceId,multisig,stakingInstance) (ContributeManager-flatten.sol#462) +Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#reentrancy-vulnerabilities-3 + + + diff --git a/audits/internal1/analysis/slither_function-summary.txt b/audits/internal1/analysis/slither_function-summary.txt new file mode 100644 index 0000000..b8c2d3e --- /dev/null +++ b/audits/internal1/analysis/slither_function-summary.txt @@ -0,0 +1,228 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers: +Contract IContributors +Contract vars: [] +Inheritance:: [] + ++--------------------------------------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| Function | Visibility | Modifiers | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++--------------------------------------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| setServiceInfoForId(address,uint256,uint256,address,address) | external | [] | [] | [] | [] | [] | 2 | +| mapSocialIdServiceInfo(address) | external | [] | [] | [] | [] | [] | 2 | ++--------------------------------------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ + ++-----------+------------+------+-------+----------------+----------------+-----------------------+ +| Modifiers | Visibility | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-----------+------------+------+-------+----------------+----------------+-----------------------+ ++-----------+------------+------+-------+----------------+----------------+-----------------------+ + +INFO:Printers: +Contract IService +Contract vars: [] +Inheritance:: [] + ++------------------------------------------------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| Function | Visibility | Modifiers | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++------------------------------------------------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| create(address,address,bytes32,uint32[],IService.AgentParams[],uint32) | external | [] | [] | [] | [] | [] | 2 | +| activateRegistration(uint256) | external | [] | [] | [] | [] | [] | 2 | +| registerAgents(uint256,address[],uint32[]) | external | [] | [] | [] | [] | [] | 2 | +| deploy(uint256,address,bytes) | external | [] | [] | [] | [] | [] | 2 | +| serviceRegistry() | external | [] | [] | [] | [] | [] | 2 | +| serviceRegistryTokenUtility() | external | [] | [] | [] | [] | [] | 2 | +| mapServices(uint256) | external | [] | [] | [] | [] | [] | 2 | ++------------------------------------------------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ + ++-----------+------------+------+-------+----------------+----------------+-----------------------+ +| Modifiers | Visibility | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-----------+------------+------+-------+----------------+----------------+-----------------------+ ++-----------+------------+------+-------+----------------+----------------+-----------------------+ + +INFO:Printers: +Contract IStaking +Contract vars: [] +Inheritance:: [] + ++-------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| Function | Visibility | Modifiers | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| stakingToken() | external | [] | [] | [] | [] | [] | 2 | +| minStakingDeposit() | external | [] | [] | [] | [] | [] | 2 | +| numAgentInstances() | external | [] | [] | [] | [] | [] | 2 | +| threshold() | external | [] | [] | [] | [] | [] | 2 | +| stake(uint256) | external | [] | [] | [] | [] | [] | 2 | +| unstake(uint256) | external | [] | [] | [] | [] | [] | 2 | +| claim(uint256) | external | [] | [] | [] | [] | [] | 2 | +| verifyInstance(address) | external | [] | [] | [] | [] | [] | 2 | ++-------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ + ++-----------+------------+------+-------+----------------+----------------+-----------------------+ +| Modifiers | Visibility | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-----------+------------+------+-------+----------------+----------------+-----------------------+ ++-----------+------------+------+-------+----------------+----------------+-----------------------+ + +INFO:Printers: +Contract IToken +Contract vars: [] +Inheritance:: [] + ++---------------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| Function | Visibility | Modifiers | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++---------------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| transfer(address,uint256) | external | [] | [] | [] | [] | [] | 2 | +| transferFrom(address,address,uint256) | external | [] | [] | [] | [] | [] | 2 | +| approve(address,uint256) | external | [] | [] | [] | [] | [] | 2 | ++---------------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ + ++-----------+------------+------+-------+----------------+----------------+-----------------------+ +| Modifiers | Visibility | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-----------+------------+------+-------+----------------+----------------+-----------------------+ ++-----------+------------+------+-------+----------------+----------------+-----------------------+ + +INFO:Printers: +Contract IMultisig +Contract vars: [] +Inheritance:: [] + ++-------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| Function | Visibility | Modifiers | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| getOwners() | external | [] | [] | [] | [] | [] | 2 | ++-------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ + ++-----------+------------+------+-------+----------------+----------------+-----------------------+ +| Modifiers | Visibility | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-----------+------------+------+-------+----------------+----------------+-----------------------+ ++-----------+------------+------+-------+----------------+----------------+-----------------------+ + +INFO:Printers: +Contract ContributeManager +Contract vars: ['NUM_AGENT_INSTANCES', 'THRESHOLD', 'agentId', 'configHash', 'contributorsProxy', 'serviceManager', 'olas', 'serviceRegistry', 'serviceRegistryTokenUtility', 'stakingFactory', 'safeMultisig', 'fallbackHandler', 'nonce'] +Inheritance:: [] + ++------------------------------------------------------------------------------+------------+-----------+-----------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+ +| Function | Visibility | Modifiers | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++------------------------------------------------------------------------------+------------+-----------+-----------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+ +| constructor(address,address,address,address,address,address,uint256,bytes32) | public | [] | ['serviceManager'] | ['agentId', 'configHash'] | ['revert ZeroAddress()', 'revert ZeroValue()'] | ['IService(serviceManager).serviceRegistry()', 'IService(serviceManager).serviceRegistryTokenUtility()'] | 3 | +| | | | | ['contributorsProxy', 'fallbackHandler'] | | | | +| | | | | ['olas', 'safeMultisig'] | | | | +| | | | | ['serviceManager', 'serviceRegistry'] | | | | +| | | | | ['serviceRegistryTokenUtility', 'stakingFactory'] | | | | +| _createAndDeploy(address,uint256) | internal | [] | ['NUM_AGENT_INSTANCES', 'THRESHOLD'] | ['nonce'] | ['abi.encodePacked()', 'keccak256(bytes)'] | ['IService(serviceManager).activateRegistration{value: 1}(serviceId)', 'IService(serviceManager).create(address(this),token,configHash,agentIds,agentParams,uint32(THRESHOLD))'] | 1 | +| | | | ['agentId', 'block.timestamp'] | | | ['IService(serviceManager).deploy(serviceId,safeMultisig,data)', 'IService(serviceManager).registerAgents{value: NUM_AGENT_INSTANCES}(serviceId,instances,agentIds)'] | | +| | | | ['configHash', 'fallbackHandler'] | | | ['IService.AgentParams(uint32(NUM_AGENT_INSTANCES),uint96(minStakingDeposit))', 'abi.encodePacked(address(0),fallbackHandler,address(0),address(0),uint256(0),randomNonce,0x)'] | | +| | | | ['msg.sender', 'nonce'] | | | ['abi.encodePacked(block.timestamp,msg.sender,localNonce)', 'new IService.AgentParams[](NUM_AGENT_INSTANCES)'] | | +| | | | ['safeMultisig', 'serviceManager'] | | | ['new address[](NUM_AGENT_INSTANCES)', 'new uint32[](NUM_AGENT_INSTANCES)'] | | +| | | | ['this'] | | | | | +| _stake(uint256,uint256,address,address) | internal | [] | ['contributorsProxy', 'msg.sender'] | [] | [] | ['IContributors(contributorsProxy).setServiceInfoForId(msg.sender,socialId,serviceId,multisig,stakingInstance)', 'IStaking(stakingInstance).stake(serviceId)'] | 1 | +| | | | ['serviceRegistry'] | | | ['IToken(serviceRegistry).approve(stakingInstance,serviceId)'] | | +| createAndStake(uint256,address) | external | [] | ['NUM_AGENT_INSTANCES', 'THRESHOLD'] | [] | ['_createAndDeploy', '_stake'] | ['IContributors(contributorsProxy).mapSocialIdServiceInfo(msg.sender)', 'IStaking(stakingFactory).verifyInstance(stakingInstance)'] | 6 | +| | | | ['contributorsProxy', 'msg.sender'] | | ['revert ServiceAlreadyStaked(uint256,uint256,address)', 'revert WrongStakingInstance(address)'] | ['IStaking(stakingInstance).minStakingDeposit()', 'IStaking(stakingInstance).numAgentInstances()'] | | +| | | | ['olas', 'serviceRegistryTokenUtility'] | | ['revert ZeroValue()'] | ['IStaking(stakingInstance).stakingToken()', 'IStaking(stakingInstance).threshold()'] | | +| | | | ['stakingFactory', 'this'] | | | ['IToken(olas).approve(serviceRegistryTokenUtility,totalBond)', 'IToken(olas).transferFrom(msg.sender,address(this),totalBond)'] | | +| stake(uint256,uint256,address) | external | [] | ['contributorsProxy', 'msg.sender'] | [] | ['_stake', 'revert ServiceAlreadyStaked(uint256,uint256,address)'] | ['IContributors(contributorsProxy).mapSocialIdServiceInfo(msg.sender)', 'IMultisig(multisig).getOwners()'] | 3 | +| | | | ['serviceRegistry', 'this'] | | ['revert WrongServiceSetup(uint256,uint256,address)'] | ['IService(serviceRegistry).mapServices(serviceId)', 'IStaking(stakingInstance).numAgentInstances()'] | | +| | | | | | | ['IToken(serviceRegistry).transferFrom(msg.sender,address(this),serviceId)'] | | +| unstake() | external | [] | ['contributorsProxy', 'msg.sender'] | [] | ['revert ServiceNotDefined(uint256)'] | ['IContributors(contributorsProxy).mapSocialIdServiceInfo(msg.sender)', 'IContributors(contributorsProxy).setServiceInfoForId(msg.sender,0,0,address(0),address(0))'] | 2 | +| | | | ['serviceRegistry'] | | | ['IStaking(stakingInstance).unstake(serviceId)', 'IToken(serviceRegistry).transfer(msg.sender,serviceId)'] | | +| claim() | external | [] | ['contributorsProxy', 'msg.sender'] | [] | ['revert ServiceNotDefined(uint256)'] | ['IContributors(contributorsProxy).mapSocialIdServiceInfo(msg.sender)', 'IStaking(stakingInstance).claim(serviceId)'] | 2 | +| slitherConstructorConstantVariables() | internal | [] | [] | ['NUM_AGENT_INSTANCES', 'THRESHOLD'] | [] | [] | 1 | ++------------------------------------------------------------------------------+------------+-----------+-----------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+ + ++-----------+------------+------+-------+----------------+----------------+-----------------------+ +| Modifiers | Visibility | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-----------+------------+------+-------+----------------+----------------+-----------------------+ ++-----------+------------+------+-------+----------------+----------------+-----------------------+ + +INFO:Printers: +Contract ContributorsProxy +Contract vars: ['CONTRIBUTORS_PROXY'] +Inheritance:: [] + ++---------------------------------------+------------+-----------+------------------------+------------------------+----------------------------------------------------------------------------+---------------------------------------------------+-----------------------+ +| Function | Visibility | Modifiers | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++---------------------------------------+------------+-----------+------------------------+------------------------+----------------------------------------------------------------------------+---------------------------------------------------+-----------------------+ +| constructor(address,bytes) | public | [] | ['CONTRIBUTORS_PROXY'] | [] | ['revert InitializationFailed()', 'revert ZeroContributorsData()'] | ['implementation.delegatecall(contributorsData)'] | 4 | +| | | | | | ['revert ZeroImplementationAddress()', 'sstore(uint256,uint256)'] | | | +| fallback() | external | [] | ['CONTRIBUTORS_PROXY'] | [] | ['calldatacopy(uint256,uint256,uint256)', 'calldatasize()'] | [] | 2 | +| | | | | | ['delegatecall(uint256,uint256,uint256,uint256,uint256,uint256)', 'gas()'] | | | +| | | | | | ['return(uint256,uint256)', 'returndatacopy(uint256,uint256,uint256)'] | | | +| | | | | | ['returndatasize()', 'revert(uint256,uint256)'] | | | +| | | | | | ['sload(uint256)'] | | | +| slitherConstructorConstantVariables() | internal | [] | [] | ['CONTRIBUTORS_PROXY'] | [] | [] | 1 | ++---------------------------------------+------------+-----------+------------------------+------------------------+----------------------------------------------------------------------------+---------------------------------------------------+-----------------------+ + ++-----------+------------+------+-------+----------------+----------------+-----------------------+ +| Modifiers | Visibility | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-----------+------------+------+-------+----------------+----------------+-----------------------+ ++-----------+------------+------+-------+----------------+----------------+-----------------------+ + +INFO:Printers: +Contract Contributors +Contract vars: ['VERSION', 'CONTRIBUTORS_PROXY', 'owner', 'manager', 'mapSocialIdServiceInfo', 'mapMutisigActivities', 'mapContributeAgents'] +Inheritance:: [] + ++--------------------------------------------------------------+------------+-----------+-------------------------------------------------+-----------------------------------+-------------------------------------------------------------------------------------+----------------+-----------------------+ +| Function | Visibility | Modifiers | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++--------------------------------------------------------------+------------+-----------+-------------------------------------------------+-----------------------------------+-------------------------------------------------------------------------------------+----------------+-----------------------+ +| initialize(address) | external | [] | ['msg.sender', 'owner'] | ['manager', 'owner'] | ['revert AlreadyInitialized()', 'revert ZeroAddress()'] | [] | 3 | +| changeImplementation(address) | external | [] | ['CONTRIBUTORS_PROXY', 'msg.sender'] | [] | ['revert OwnerOnly(address,address)', 'revert ZeroAddress()'] | [] | 3 | +| | | | ['owner'] | | ['sstore(uint256,uint256)'] | | | +| changeOwner(address) | external | [] | ['msg.sender', 'owner'] | ['owner'] | ['revert OwnerOnly(address,address)', 'revert ZeroAddress()'] | [] | 3 | +| changeManager(address) | external | [] | ['msg.sender', 'owner'] | ['manager'] | ['revert OwnerOnly(address,address)', 'revert ZeroAddress()'] | [] | 3 | +| setServiceInfoForId(address,uint256,uint256,address,address) | external | [] | ['manager', 'mapSocialIdServiceInfo'] | ['mapSocialIdServiceInfo'] | ['revert OnlyManager(address,address)'] | [] | 2 | +| | | | ['msg.sender'] | | | | | +| setContributeAgentStatuses(address[],bool[]) | external | [] | ['msg.sender', 'owner'] | ['mapContributeAgents'] | ['revert OwnerOnly(address,address)', 'revert WrongArrayLength(uint256,uint256)'] | [] | 5 | +| | | | | | ['revert ZeroAddress()'] | | | +| increaseActivity(address[],uint256[]) | external | [] | ['mapContributeAgents', 'mapMutisigActivities'] | ['mapMutisigActivities'] | ['revert UnauthorizedAccount(address)', 'revert WrongArrayLength(uint256,uint256)'] | [] | 4 | +| | | | ['msg.sender'] | | | | | +| slitherConstructorConstantVariables() | internal | [] | [] | ['CONTRIBUTORS_PROXY', 'VERSION'] | [] | [] | 1 | ++--------------------------------------------------------------+------------+-----------+-------------------------------------------------+-----------------------------------+-------------------------------------------------------------------------------------+----------------+-----------------------+ + ++-----------+------------+------+-------+----------------+----------------+-----------------------+ +| Modifiers | Visibility | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-----------+------------+------+-------+----------------+----------------+-----------------------+ ++-----------+------------+------+-------+----------------+----------------+-----------------------+ + +INFO:Printers: +Contract IContributors +Contract vars: [] +Inheritance:: [] + ++-------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| Function | Visibility | Modifiers | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ +| mapMutisigActivities(address) | external | [] | [] | [] | [] | [] | 2 | ++-------------------------------+------------+-----------+------+-------+----------------+----------------+-----------------------+ + ++-----------+------------+------+-------+----------------+----------------+-----------------------+ +| Modifiers | Visibility | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-----------+------------+------+-------+----------------+----------------+-----------------------+ ++-----------+------------+------+-------+----------------+----------------+-----------------------+ + +INFO:Printers: +Contract ContributeActivityChecker +Contract vars: ['livenessRatio', 'contributorsProxy'] +Inheritance:: [] + ++------------------------------------------+------------+-----------+-----------------------+----------------------------------------+------------------------------------------------+-----------------------------------------------------------------------------------------+-----------------------+ +| Function | Visibility | Modifiers | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++------------------------------------------+------------+-----------+-----------------------+----------------------------------------+------------------------------------------------+-----------------------------------------------------------------------------------------+-----------------------+ +| constructor(address,uint256) | public | [] | [] | ['contributorsProxy', 'livenessRatio'] | ['revert ZeroAddress()', 'revert ZeroValue()'] | [] | 3 | +| getMultisigNonces(address) | external | [] | ['contributorsProxy'] | [] | [] | ['IContributors(contributorsProxy).mapMutisigActivities(multisig)', 'new uint256[](1)'] | 1 | +| isRatioPass(uint256[],uint256[],uint256) | external | [] | ['livenessRatio'] | [] | [] | [] | 2 | ++------------------------------------------+------------+-----------+-----------------------+----------------------------------------+------------------------------------------------+-----------------------------------------------------------------------------------------+-----------------------+ + ++-----------+------------+------+-------+----------------+----------------+-----------------------+ +| Modifiers | Visibility | Read | Write | Internal Calls | External Calls | Cyclomatic Complexity | ++-----------+------------+------+-------+----------------+----------------+-----------------------+ ++-----------+------------+------+-------+----------------+----------------+-----------------------+ + +INFO:Slither:. analyzed (10 contracts) diff --git a/audits/internal1/analysis/slither_human-summary.txt b/audits/internal1/analysis/slither_human-summary.txt new file mode 100644 index 0000000..3fcd87a --- /dev/null +++ b/audits/internal1/analysis/slither_human-summary.txt @@ -0,0 +1,84 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers: +Compiled with solc +Total number of contracts in source files: 6 +Source lines of code (SLOC) in source files: 213 +Number of assembly lines: 0 +Number of optimization issues: 3 +Number of informational issues: 2 +Number of low issues: 4 +Number of medium issues: 9 +Number of high issues: 5 + ++-------------------+-------------+------+------------+--------------+--------------------+ +| Name | # functions | ERCS | ERC20 info | Complex code | Features | ++-------------------+-------------+------+------------+--------------+--------------------+ +| IContributors | 2 | | | No | | +| IService | 7 | | | No | Receive ETH | +| IStaking | 8 | | | No | | +| IToken | 3 | | | No | | +| IMultisig | 1 | | | No | | +| ContributeManager | 8 | | | No | Receive ETH | +| | | | | | Send ETH | +| | | | | | Tokens interaction | ++-------------------+-------------+------+------------+--------------+--------------------+ +INFO:Printers: +Compiled with solc +Total number of contracts in source files: 1 +Source lines of code (SLOC) in source files: 34 +Number of assembly lines: 0 +Number of optimization issues: 0 +Number of informational issues: 5 +Number of low issues: 0 +Number of medium issues: 1 +Number of high issues: 2 + ++-------------------+-------------+------+------------+--------------+--------------+ +| Name | # functions | ERCS | ERC20 info | Complex code | Features | ++-------------------+-------------+------+------------+--------------+--------------+ +| ContributorsProxy | 3 | | | No | Delegatecall | +| | | | | | Assembly | +| | | | | | Proxy | ++-------------------+-------------+------+------------+--------------+--------------+ +INFO:Printers: +Compiled with solc +Total number of contracts in source files: 1 +Source lines of code (SLOC) in source files: 115 +Number of assembly lines: 0 +Number of optimization issues: 0 +Number of informational issues: 4 +Number of low issues: 0 +Number of medium issues: 0 +Number of high issues: 2 + ++--------------+-------------+------+------------+--------------+----------+ +| Name | # functions | ERCS | ERC20 info | Complex code | Features | ++--------------+-------------+------+------------+--------------+----------+ +| Contributors | 8 | | | No | Assembly | ++--------------+-------------+------+------------+--------------+----------+ +INFO:Printers: +Compiled with solc +Total number of contracts in source files: 2 +Source lines of code (SLOC) in source files: 34 +Number of assembly lines: 0 +Number of optimization issues: 0 +Number of informational issues: 2 +Number of low issues: 0 +Number of medium issues: 0 +Number of high issues: 0 + + ++---------------------------+-------------+------+------------+--------------+----------+ +| Name | # functions | ERCS | ERC20 info | Complex code | Features | ++---------------------------+-------------+------+------------+--------------+----------+ +| IContributors | 1 | | | No | | +| ContributeActivityChecker | 3 | | | No | | ++---------------------------+-------------+------+------------+--------------+----------+ +INFO:Slither:. analyzed (10 contracts) diff --git a/audits/internal1/analysis/slither_inheritance-graph.txt b/audits/internal1/analysis/slither_inheritance-graph.txt new file mode 100644 index 0000000..f263597 --- /dev/null +++ b/audits/internal1/analysis/slither_inheritance-graph.txt @@ -0,0 +1,17 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers:Inheritance Graph: ./ContributeManager-flatten.sol.inheritance-graph.dot + +INFO:Printers:Inheritance Graph: ./ContributorsProxy-flatten.sol.inheritance-graph.dot + +INFO:Printers:Inheritance Graph: ./Contributors-flatten.sol.inheritance-graph.dot + +INFO:Printers:Inheritance Graph: ./ContributeActivityChecker-flatten.sol.inheritance-graph.dot + +INFO:Slither:. analyzed (10 contracts) diff --git a/audits/internal1/analysis/slither_inheritance.txt b/audits/internal1/analysis/slither_inheritance.txt new file mode 100644 index 0000000..a01445b --- /dev/null +++ b/audits/internal1/analysis/slither_inheritance.txt @@ -0,0 +1,73 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers:Inheritance +Child_Contract -> Immediate_Base_Contracts [Not_Immediate_Base_Contracts] ++ IContributors + ++ IService + ++ IStaking + ++ IToken + ++ IMultisig + ++ ContributeManager + + +Base_Contract -> Immediate_Child_Contracts + [Not_Immediate_Child_Contracts] + ++ IContributors + ++ IService + ++ IStaking + ++ IToken + ++ IMultisig + ++ ContributeManager + +INFO:Printers:Inheritance +Child_Contract -> Immediate_Base_Contracts [Not_Immediate_Base_Contracts] ++ ContributorsProxy + + +Base_Contract -> Immediate_Child_Contracts + [Not_Immediate_Child_Contracts] + ++ ContributorsProxy + +INFO:Printers:Inheritance +Child_Contract -> Immediate_Base_Contracts [Not_Immediate_Base_Contracts] ++ Contributors + + +Base_Contract -> Immediate_Child_Contracts + [Not_Immediate_Child_Contracts] + ++ Contributors + +INFO:Printers:Inheritance +Child_Contract -> Immediate_Base_Contracts [Not_Immediate_Base_Contracts] ++ IContributors + ++ ContributeActivityChecker + + +Base_Contract -> Immediate_Child_Contracts + [Not_Immediate_Child_Contracts] + ++ IContributors + ++ ContributeActivityChecker + +INFO:Slither:. analyzed (10 contracts) diff --git a/audits/internal1/analysis/slither_modifiers.txt b/audits/internal1/analysis/slither_modifiers.txt new file mode 100644 index 0000000..bd686ca --- /dev/null +++ b/audits/internal1/analysis/slither_modifiers.txt @@ -0,0 +1,113 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers: +Contract IContributors ++------------------------+-----------+ +| Function | Modifiers | ++------------------------+-----------+ +| setServiceInfoForId | [] | +| mapSocialIdServiceInfo | [] | ++------------------------+-----------+ +INFO:Printers: +Contract IService ++-----------------------------+-----------+ +| Function | Modifiers | ++-----------------------------+-----------+ +| create | [] | +| activateRegistration | [] | +| registerAgents | [] | +| deploy | [] | +| serviceRegistry | [] | +| serviceRegistryTokenUtility | [] | +| mapServices | [] | ++-----------------------------+-----------+ +INFO:Printers: +Contract IStaking ++-------------------+-----------+ +| Function | Modifiers | ++-------------------+-----------+ +| stakingToken | [] | +| minStakingDeposit | [] | +| numAgentInstances | [] | +| threshold | [] | +| stake | [] | +| unstake | [] | +| claim | [] | +| verifyInstance | [] | ++-------------------+-----------+ +INFO:Printers: +Contract IToken ++--------------+-----------+ +| Function | Modifiers | ++--------------+-----------+ +| transfer | [] | +| transferFrom | [] | +| approve | [] | ++--------------+-----------+ +INFO:Printers: +Contract IMultisig ++-----------+-----------+ +| Function | Modifiers | ++-----------+-----------+ +| getOwners | [] | ++-----------+-----------+ +INFO:Printers: +Contract ContributeManager ++-------------------------------------+-----------+ +| Function | Modifiers | ++-------------------------------------+-----------+ +| constructor | [] | +| _createAndDeploy | [] | +| _stake | [] | +| createAndStake | [] | +| stake | [] | +| unstake | [] | +| claim | [] | +| slitherConstructorConstantVariables | [] | ++-------------------------------------+-----------+ +INFO:Printers: +Contract ContributorsProxy ++-------------------------------------+-----------+ +| Function | Modifiers | ++-------------------------------------+-----------+ +| constructor | [] | +| fallback | [] | +| slitherConstructorConstantVariables | [] | ++-------------------------------------+-----------+ +INFO:Printers: +Contract Contributors ++-------------------------------------+-----------+ +| Function | Modifiers | ++-------------------------------------+-----------+ +| initialize | [] | +| changeImplementation | [] | +| changeOwner | [] | +| changeManager | [] | +| setServiceInfoForId | [] | +| setContributeAgentStatuses | [] | +| increaseActivity | [] | +| slitherConstructorConstantVariables | [] | ++-------------------------------------+-----------+ +INFO:Printers: +Contract IContributors ++----------------------+-----------+ +| Function | Modifiers | ++----------------------+-----------+ +| mapMutisigActivities | [] | ++----------------------+-----------+ +INFO:Printers: +Contract ContributeActivityChecker ++-------------------+-----------+ +| Function | Modifiers | ++-------------------+-----------+ +| constructor | [] | +| getMultisigNonces | [] | +| isRatioPass | [] | ++-------------------+-----------+ +INFO:Slither:. analyzed (10 contracts) diff --git a/audits/internal1/analysis/slither_require.txt b/audits/internal1/analysis/slither_require.txt new file mode 100644 index 0000000..a8d135a --- /dev/null +++ b/audits/internal1/analysis/slither_require.txt @@ -0,0 +1,113 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers: +Contract IContributors ++------------------------+-------------------+ +| Function | require or assert | ++------------------------+-------------------+ +| setServiceInfoForId | | +| mapSocialIdServiceInfo | | ++------------------------+-------------------+ +INFO:Printers: +Contract IService ++-----------------------------+-------------------+ +| Function | require or assert | ++-----------------------------+-------------------+ +| create | | +| activateRegistration | | +| registerAgents | | +| deploy | | +| serviceRegistry | | +| serviceRegistryTokenUtility | | +| mapServices | | ++-----------------------------+-------------------+ +INFO:Printers: +Contract IStaking ++-------------------+-------------------+ +| Function | require or assert | ++-------------------+-------------------+ +| stakingToken | | +| minStakingDeposit | | +| numAgentInstances | | +| threshold | | +| stake | | +| unstake | | +| claim | | +| verifyInstance | | ++-------------------+-------------------+ +INFO:Printers: +Contract IToken ++--------------+-------------------+ +| Function | require or assert | ++--------------+-------------------+ +| transfer | | +| transferFrom | | +| approve | | ++--------------+-------------------+ +INFO:Printers: +Contract IMultisig ++-----------+-------------------+ +| Function | require or assert | ++-----------+-------------------+ +| getOwners | | ++-----------+-------------------+ +INFO:Printers: +Contract ContributeManager ++-------------------------------------+-------------------+ +| Function | require or assert | ++-------------------------------------+-------------------+ +| constructor | | +| _createAndDeploy | | +| _stake | | +| createAndStake | | +| stake | | +| unstake | | +| claim | | +| slitherConstructorConstantVariables | | ++-------------------------------------+-------------------+ +INFO:Printers: +Contract ContributorsProxy ++-------------------------------------+-------------------+ +| Function | require or assert | ++-------------------------------------+-------------------+ +| constructor | | +| fallback | | +| slitherConstructorConstantVariables | | ++-------------------------------------+-------------------+ +INFO:Printers: +Contract Contributors ++-------------------------------------+-------------------+ +| Function | require or assert | ++-------------------------------------+-------------------+ +| initialize | | +| changeImplementation | | +| changeOwner | | +| changeManager | | +| setServiceInfoForId | | +| setContributeAgentStatuses | | +| increaseActivity | | +| slitherConstructorConstantVariables | | ++-------------------------------------+-------------------+ +INFO:Printers: +Contract IContributors ++----------------------+-------------------+ +| Function | require or assert | ++----------------------+-------------------+ +| mapMutisigActivities | | ++----------------------+-------------------+ +INFO:Printers: +Contract ContributeActivityChecker ++-------------------+-------------------+ +| Function | require or assert | ++-------------------+-------------------+ +| constructor | | +| getMultisigNonces | | +| isRatioPass | | ++-------------------+-------------------+ +INFO:Slither:. analyzed (10 contracts) diff --git a/audits/internal1/analysis/slither_variable-order.txt b/audits/internal1/analysis/slither_variable-order.txt new file mode 100644 index 0000000..da2c732 --- /dev/null +++ b/audits/internal1/analysis/slither_variable-order.txt @@ -0,0 +1,79 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers: +IContributors: ++------+------+------+--------+ +| Name | Type | Slot | Offset | ++------+------+------+--------+ ++------+------+------+--------+ + +IService: ++------+------+------+--------+ +| Name | Type | Slot | Offset | ++------+------+------+--------+ ++------+------+------+--------+ + +IStaking: ++------+------+------+--------+ +| Name | Type | Slot | Offset | ++------+------+------+--------+ ++------+------+------+--------+ + +IToken: ++------+------+------+--------+ +| Name | Type | Slot | Offset | ++------+------+------+--------+ ++------+------+------+--------+ + +IMultisig: ++------+------+------+--------+ +| Name | Type | Slot | Offset | ++------+------+------+--------+ ++------+------+------+--------+ + +ContributeManager: ++-------------------------+---------+------+--------+ +| Name | Type | Slot | Offset | ++-------------------------+---------+------+--------+ +| ContributeManager.nonce | uint256 | 0 | 0 | ++-------------------------+---------+------+--------+ + +INFO:Printers: +ContributorsProxy: ++------+------+------+--------+ +| Name | Type | Slot | Offset | ++------+------+------+--------+ ++------+------+------+--------+ + +INFO:Printers: +Contributors: ++-------------------------------------+---------------------------------+------+--------+ +| Name | Type | Slot | Offset | ++-------------------------------------+---------------------------------+------+--------+ +| Contributors.owner | address | 0 | 0 | +| Contributors.manager | address | 1 | 0 | +| Contributors.mapSocialIdServiceInfo | mapping(address => ServiceInfo) | 2 | 0 | +| Contributors.mapMutisigActivities | mapping(address => uint256) | 3 | 0 | +| Contributors.mapContributeAgents | mapping(address => bool) | 4 | 0 | ++-------------------------------------+---------------------------------+------+--------+ + +INFO:Printers: +IContributors: ++------+------+------+--------+ +| Name | Type | Slot | Offset | ++------+------+------+--------+ ++------+------+------+--------+ + +ContributeActivityChecker: ++------+------+------+--------+ +| Name | Type | Slot | Offset | ++------+------+------+--------+ ++------+------+------+--------+ + +INFO:Slither:. analyzed (10 contracts) diff --git a/audits/internal1/analysis/slither_vars-and-auth.txt b/audits/internal1/analysis/slither_vars-and-auth.txt new file mode 100644 index 0000000..1ffe245 --- /dev/null +++ b/audits/internal1/analysis/slither_vars-and-auth.txt @@ -0,0 +1,117 @@ +'solc --version' running +'solc ./ContributeManager-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributorsProxy-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./Contributors-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +'solc --version' running +'solc ./ContributeActivityChecker-flatten.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/andrey/valory/autonolas-staking-programmes/audits/internal1/analysis/contracts' running +INFO:Printers: +Contract IContributors ++------------------------+-------------------------+--------------------------+ +| Function | State variables written | Conditions on msg.sender | ++------------------------+-------------------------+--------------------------+ +| setServiceInfoForId | [] | [] | +| mapSocialIdServiceInfo | [] | [] | ++------------------------+-------------------------+--------------------------+ + +Contract IService ++-----------------------------+-------------------------+--------------------------+ +| Function | State variables written | Conditions on msg.sender | ++-----------------------------+-------------------------+--------------------------+ +| create | [] | [] | +| activateRegistration | [] | [] | +| registerAgents | [] | [] | +| deploy | [] | [] | +| serviceRegistry | [] | [] | +| serviceRegistryTokenUtility | [] | [] | +| mapServices | [] | [] | ++-----------------------------+-------------------------+--------------------------+ + +Contract IStaking ++-------------------+-------------------------+--------------------------+ +| Function | State variables written | Conditions on msg.sender | ++-------------------+-------------------------+--------------------------+ +| stakingToken | [] | [] | +| minStakingDeposit | [] | [] | +| numAgentInstances | [] | [] | +| threshold | [] | [] | +| stake | [] | [] | +| unstake | [] | [] | +| claim | [] | [] | +| verifyInstance | [] | [] | ++-------------------+-------------------------+--------------------------+ + +Contract IToken ++--------------+-------------------------+--------------------------+ +| Function | State variables written | Conditions on msg.sender | ++--------------+-------------------------+--------------------------+ +| transfer | [] | [] | +| transferFrom | [] | [] | +| approve | [] | [] | ++--------------+-------------------------+--------------------------+ + +Contract IMultisig ++-----------+-------------------------+--------------------------+ +| Function | State variables written | Conditions on msg.sender | ++-----------+-------------------------+--------------------------+ +| getOwners | [] | [] | ++-----------+-------------------------+--------------------------+ + +Contract ContributeManager ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+ +| Function | State variables written | Conditions on msg.sender | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+ +| constructor | ['agentId', 'configHash', 'contributorsProxy', 'fallbackHandler', 'olas', 'safeMultisig', 'serviceManager', 'serviceRegistry', 'serviceRegistryTokenUtility', 'stakingFactory'] | [] | +| _createAndDeploy | ['nonce'] | [] | +| _stake | [] | [] | +| createAndStake | ['nonce'] | [] | +| stake | [] | ['multisigOwners.length != numAgentInstances || multisigOwners[0] != msg.sender'] | +| unstake | [] | [] | +| claim | [] | [] | +| slitherConstructorConstantVariables | ['NUM_AGENT_INSTANCES', 'THRESHOLD'] | [] | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+ + +INFO:Printers: +Contract ContributorsProxy ++-------------------------------------+-------------------------+--------------------------+ +| Function | State variables written | Conditions on msg.sender | ++-------------------------------------+-------------------------+--------------------------+ +| constructor | [] | [] | +| fallback | [] | [] | +| slitherConstructorConstantVariables | ['CONTRIBUTORS_PROXY'] | [] | ++-------------------------------------+-------------------------+--------------------------+ + +INFO:Printers: +Contract Contributors ++-------------------------------------+-----------------------------------+---------------------------------------+ +| Function | State variables written | Conditions on msg.sender | ++-------------------------------------+-----------------------------------+---------------------------------------+ +| initialize | ['manager', 'owner'] | [] | +| changeImplementation | [] | ['msg.sender != owner'] | +| changeOwner | ['owner'] | ['msg.sender != owner'] | +| changeManager | ['manager'] | ['msg.sender != owner'] | +| setServiceInfoForId | ['mapSocialIdServiceInfo'] | ['msg.sender != manager'] | +| setContributeAgentStatuses | ['mapContributeAgents'] | ['msg.sender != owner'] | +| increaseActivity | ['mapMutisigActivities'] | ['! mapContributeAgents[msg.sender]'] | +| slitherConstructorConstantVariables | ['CONTRIBUTORS_PROXY', 'VERSION'] | [] | ++-------------------------------------+-----------------------------------+---------------------------------------+ + +INFO:Printers: +Contract IContributors ++----------------------+-------------------------+--------------------------+ +| Function | State variables written | Conditions on msg.sender | ++----------------------+-------------------------+--------------------------+ +| mapMutisigActivities | [] | [] | ++----------------------+-------------------------+--------------------------+ + +Contract ContributeActivityChecker ++-------------------+----------------------------------------+--------------------------+ +| Function | State variables written | Conditions on msg.sender | ++-------------------+----------------------------------------+--------------------------+ +| constructor | ['contributorsProxy', 'livenessRatio'] | [] | +| getMultisigNonces | [] | [] | +| isRatioPass | [] | [] | ++-------------------+----------------------------------------+--------------------------+ + +INFO:Slither:. analyzed (10 contracts)