Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
Multichain Info
N/A
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
| Parent Transaction Hash | Block | From | To | Amount | ||
|---|---|---|---|---|---|---|
| 236478921 | 27 hrs ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
ConvictionsUtils
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 0 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import {CVParams} from "./ICVStrategy.sol";
library ConvictionsUtils {
uint256 public constant D = 10000000; // 10**7
uint256 internal constant TWO_128 = 0x100000000000000000000000000000000; // 2**128
uint256 internal constant TWO_127 = 0x80000000000000000000000000000000; // 2**127
/**
* @dev Conviction formula: a^t * y(0) + x * (1 - a^t) / (1 - a)
* Solidity implementation: y = (2^128 * a^t * y0 + x * D * (2^128 - 2^128 * a^t) / (D - aD) + 2^127) / 2^128
* @param _timePassed Number of blocks since last conviction record
* @param _lastConv Last conviction record
* @param _oldAmount Amount of tokens staked until now
* @return Current conviction
*/
function calculateConviction(uint256 _timePassed, uint256 _lastConv, uint256 _oldAmount, uint256 _decay)
public
pure
returns (uint256)
{
uint256 t = _timePassed;
// atTWO_128 = 2^128 * a^t
// @audit-issue why that _pow require that need be less than TWO_128? why dont use 256?
// @audit-ok they use 2^128 as the container for the result of the _pow function
uint256 atTWO_128 = _pow((_decay << 128) / D, t);
return (((atTWO_128 * _lastConv) + ((_oldAmount * D * (TWO_128 - atTWO_128)) / (D - _decay))) + TWO_127) >> 128;
}
/**
* @dev Formula: ρ * totalStaked / (1 - a) / (β - requestedAmount / total)**2
* For the Solidity implementation we amplify ρ and β and simplify the formula:
* weight = ρ * D
* maxRatio = β * D
* decay = a * D
* threshold = weight * totalStaked * D ** 2 * funds ** 2 / (D - decay) / (maxRatio * funds - requestedAmount * D) ** 2
* @param _requestedAmount Requested amount of tokens on certain proposal
* @return _threshold Threshold a proposal's conviction should surpass in order to be able to
* executed it.
*/
function calculateThreshold(
uint256 _requestedAmount,
uint256 _poolAmount,
uint256 _totalPointsActivated,
uint256 _decay,
uint256 _weight,
uint256 _maxRatio,
uint256 _minThresholdPoints
) public pure returns (uint256 _threshold) {
uint256 denom = (_maxRatio * 2 ** 64) / D - (_requestedAmount * 2 ** 64) / _poolAmount;
_threshold =
((((((_weight << 128) / D) / ((denom * denom) >> 64)) * D) / (D - _decay)) * _totalPointsActivated) >> 64;
if (_totalPointsActivated != 0) {
uint256 thresholdOverride = (
(_minThresholdPoints * D * getMaxConviction(_totalPointsActivated, _decay)) / (_totalPointsActivated)
) / 10 ** 7;
_threshold = _threshold > thresholdOverride ? _threshold : thresholdOverride;
}
}
function getMaxConviction(uint256 amount, uint256 _decay) public pure returns (uint256) {
return ((amount * D) / (D - _decay));
}
/**
* Calculate (_a / 2^128)^_b * 2^128. Parameter _a should be less than 2^128.
*
* @param _a left argument
* @param _b right argument
* @return _result (_a / 2^128)^_b * 2^128
*/
function _pow(uint256 _a, uint256 _b) internal pure returns (uint256 _result) {
// TODO: Uncomment when contract size fixed with diamond
// if (_a >= TWO_128) {
// revert AShouldBeUnderTwo_128();
// }
uint256 a = _a;
uint256 b = _b;
_result = TWO_128;
while (b > 0) {
if (b & 1 == 0) {
a = _mul(a, a);
b >>= 1;
} else {
_result = _mul(_result, a);
b -= 1;
}
}
}
/**
* Multiply _a by _b / 2^128. Parameter _a should be less than or equal to
* 2^128 and parameter _b should be less than 2^128.
* @param _a left argument
* @param _b right argument
* @return _result _a * _b / 2^128
*/
function _mul(uint256 _a, uint256 _b) internal pure returns (uint256 _result) {
// TODO: Uncomment when contract size fixed with diamond
// if (_a > TWO_128) {
// revert AShouldBeUnderOrEqTwo_128();
// }
// if (_b > TWO_128) {
// revert BShouldBeLessTwo_128();
// }
return ((_a * _b) + TWO_127) >> 128;
}
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.19;
import {IArbitrator} from "../interfaces/IArbitrator.sol";
import {Metadata} from "allo-v2-contracts/core/interfaces/IRegistry.sol";
/*|--------------------------------------------|*/
/*| STRUCTS/ENUMS |*/
/*|--------------------------------------------|*/
// interface IPointStrategy {
// function deactivatePoints(address _member) external;
// function increasePower(address _member, uint256 _amountToStake) external returns (uint256);
// function decreasePower(address _member, uint256 _amountToUntake) external returns (uint256);
// function getPointSystem() external returns (PointSystem);
// }
enum ProposalType {
Signaling,
Funding,
Streaming
}
enum PointSystem {
Fixed,
Capped,
Unlimited,
Quadratic
}
struct CreateProposal {
// uint256 proposalId;
uint256 poolId;
address beneficiary;
// ProposalType proposalType;
uint256 amountRequested;
address requestedToken;
Metadata metadata;
}
enum ProposalStatus {
Inactive, // Inactive
Active, // A vote that has been reported to Agreements
Paused, // A votee that is being challenged by Agreements
Cancelled, // A vote that has been cancelled
Executed, // A vote that has been executed
Disputed, // A vote that has been disputed
Rejected // A vote that has been rejected
}
struct ProposalDisputeInfo {
uint256 disputeId;
uint256 disputeTimestamp;
address challenger;
}
struct Proposal {
uint256 proposalId;
uint256 requestedAmount;
uint256 stakedAmount;
uint256 convictionLast;
address beneficiary;
address submitter;
address requestedToken;
uint256 blockLast;
ProposalStatus proposalStatus;
mapping(address => uint256) voterStakedPoints; // voter staked points
Metadata metadata;
ProposalDisputeInfo disputeInfo;
uint256 lastDisputeCompletion;
uint256 arbitrableConfigVersion;
uint256 creationTimestamp;
}
struct ProposalSupport {
uint256 proposalId;
int256 deltaSupport; // use int256 to allow negative values
}
struct PointSystemConfig {
//Capped point system
uint256 maxAmount;
}
struct ArbitrableConfig {
IArbitrator arbitrator;
address tribunalSafe;
uint256 submitterCollateralAmount;
uint256 challengerCollateralAmount;
uint256 defaultRuling;
uint256 defaultRulingTimeout;
}
struct CVParams {
uint256 maxRatio;
uint256 weight;
uint256 decay;
uint256 minThresholdPoints;
}
struct CVStrategyInitializeParamsV0_0 {
CVParams cvParams;
ProposalType proposalType;
PointSystem pointSystem;
PointSystemConfig pointConfig;
ArbitrableConfig arbitrableConfig;
address registryCommunity;
address sybilScorer;
}
struct CVStrategyInitializeParamsV0_1 {
CVParams cvParams;
ProposalType proposalType;
PointSystem pointSystem;
PointSystemConfig pointConfig;
ArbitrableConfig arbitrableConfig;
address registryCommunity;
address sybilScorer;
uint256 sybilScorerThreshold;
address[] initialAllowlist;
}
struct CVStrategyInitializeParamsV0_2 {
CVParams cvParams;
ProposalType proposalType;
PointSystem pointSystem;
PointSystemConfig pointConfig;
ArbitrableConfig arbitrableConfig;
address registryCommunity;
address sybilScorer;
uint256 sybilScorerThreshold;
address[] initialAllowlist;
address superfluidToken;
}
interface ICVStrategy {
function setPoolParams(
ArbitrableConfig memory _arbitrableConfig,
CVParams memory _cvParams,
uint256 _sybilScoreThreshold,
address[] memory _membersToAdd,
address[] memory _membersToRemove,
address _superfluidToken
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./IArbitrable.sol";
/// @title Arbitrator
/// Arbitrator interface that implements the new arbitration standard.
/// Unlike the ERC-792 this standard is not concerned with appeals, so each arbitrator can implement an appeal system that suits it the most.
/// When developing arbitrator contracts we need to:
/// - Define the functions for dispute creation (createDispute). Don't forget to store the arbitrated contract and the disputeID (which should be unique, may nbDisputes).
/// - Define the functions for cost display (arbitrationCost).
/// - Allow giving rulings. For this a function must call arbitrable.rule(disputeID, ruling).
interface IArbitrator {
/// @dev To be emitted when a dispute is created.
/// @param _disputeID The identifier of the dispute in the Arbitrator contract.
/// @param _arbitrable The contract which created the dispute.
event DisputeCreation(
uint256 indexed _disputeID,
IArbitrable indexed _arbitrable
);
/// @dev To be raised when a ruling is given.
/// @param _arbitrable The arbitrable receiving the ruling.
/// @param _disputeID The identifier of the dispute in the Arbitrator contract.
/// @param _ruling The ruling which was given.
event Ruling(
IArbitrable indexed _arbitrable,
uint256 indexed _disputeID,
uint256 _ruling
);
/// @dev To be emitted when an ERC20 token is added or removed as a method to pay fees.
/// @param _token The ERC20 token.
/// @param _accepted Whether the token is accepted or not.
event AcceptedFeeToken(IERC20 indexed _token, bool indexed _accepted);
/// @dev To be emitted when the fee for a particular ERC20 token is updated.
/// @param _feeToken The ERC20 token.
/// @param _rateInEth The new rate of the fee token in ETH.
/// @param _rateDecimals The new decimals of the fee token rate.
event NewCurrencyRate(
IERC20 indexed _feeToken,
uint64 _rateInEth,
uint8 _rateDecimals
);
/// @dev Create a dispute and pay for the fees in the native currency, typically ETH.
/// Must be called by the arbitrable contract.
/// Must pay at least arbitrationCost(_extraData).
/// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.
/// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).
/// @return disputeID The identifier of the dispute created.
function createDispute(
uint256 _numberOfChoices,
bytes calldata _extraData
) external payable returns (uint256 disputeID);
/// @dev Create a dispute and pay for the fees in a supported ERC20 token.
/// Must be called by the arbitrable contract.
/// Must pay at least arbitrationCost(_extraData).
/// @param _numberOfChoices The number of choices the arbitrator can choose from in this dispute.
/// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).
/// @param _feeToken The ERC20 token used to pay fees.
/// @param _feeAmount Amount of the ERC20 token used to pay fees.
/// @return disputeID The identifier of the dispute created.
function createDispute(
uint256 _numberOfChoices,
bytes calldata _extraData,
IERC20 _feeToken,
uint256 _feeAmount
) external returns (uint256 disputeID);
/// @dev Compute the cost of arbitration denominated in the native currency, typically ETH.
/// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.
/// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).
/// @return cost The arbitration cost in ETH.
function arbitrationCost(
bytes calldata _extraData
) external view returns (uint256 cost);
/// @dev Compute the cost of arbitration denominated in `_feeToken`.
/// It is recommended not to increase it often, as it can be highly time and gas consuming for the arbitrated contracts to cope with fee augmentation.
/// @param _extraData Additional info about the dispute. We use it to pass the ID of the dispute's court (first 32 bytes), the minimum number of jurors required (next 32 bytes) and the ID of the specific dispute kit (last 32 bytes).
/// @param _feeToken The ERC20 token used to pay fees.
/// @return cost The arbitration cost in `_feeToken`.
function arbitrationCost(
bytes calldata _extraData,
IERC20 _feeToken
) external view returns (uint256 cost);
/// @dev Gets the current ruling of a specified dispute.
/// @param _disputeID The ID of the dispute.
/// @return ruling The current ruling.
/// @return tied Whether it's a tie or not.
/// @return overridden Whether the ruling was overridden by appeal funding or not.
function currentRuling(
uint256 _disputeID
) external view returns (uint256 ruling, bool tied, bool overridden);
// Interface override
/// @dev Authorize the safe to execute a ruling on the source contract.<
/// @param _safe that acts as the Tribunal safe that can rule disputes from the source Strategy.
function registerSafe(address _safe) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
// Internal Libraries
import {Metadata} from "../libraries/Metadata.sol";
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⢿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⡟⠘⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⣀⣴⣾⣿⣿⣿⣿⣾⠻⣿⣿⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⡿⠀⠀⠸⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⢀⣠⣴⣴⣶⣶⣶⣦⣦⣀⡀⠀⠀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⡿⠃⠀⠙⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⠁⠀⠀⠀⢻⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⡀⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀⠘⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⠃⠀⠀⠀⠀⠈⢿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⣰⣿⣿⣿⡿⠋⠁⠀⠀⠈⠘⠹⣿⣿⣿⣿⣆⠀⠀⠀
// ⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠈⢿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⢰⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⡀⠀⠀
// ⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣟⠀⡀⢀⠀⡀⢀⠀⡀⢈⢿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⡇⠀⠀
// ⠀⠀⣠⣿⣿⣿⣿⣿⣿⡿⠋⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⡿⢿⠿⠿⠿⠿⠿⠿⠿⠿⠿⢿⣿⣿⣿⣷⡀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠸⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⠂⠀⠀
// ⠀⠀⠙⠛⠿⠻⠻⠛⠉⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⣿⣿⣧⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⢻⣿⣿⣿⣷⣀⢀⠀⠀⠀⡀⣰⣾⣿⣿⣿⠏⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣧⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠹⢿⣿⣿⣿⣿⣾⣾⣷⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀
// ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠙⠋⠛⠙⠋⠛⠙⠋⠛⠙⠋⠃⠀⠀⠀⠀⠀⠀⠀⠀⠠⠿⠻⠟⠿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠟⠿⠟⠿⠆⠀⠸⠿⠿⠟⠯⠀⠀⠀⠸⠿⠿⠿⠏⠀⠀⠀⠀⠀⠈⠉⠻⠻⡿⣿⢿⡿⡿⠿⠛⠁⠀⠀⠀⠀⠀⠀
// allo.gitcoin.co
/// @title IRegistry Interface
/// @author @thelostone-mc <[email protected]>, @0xKurt <[email protected]>, @codenamejason <[email protected]>, @0xZakk <[email protected]>, @nfrgosselin <[email protected]>
/// @notice Interface for the Registry contract and exposes all functions needed to use the Registry
/// within the Allo protocol.
/// @dev The Registry Interface is used to interact with the Allo protocol and create profiles
/// that can be used to interact with the Allo protocol. The Registry is the main contract
/// that all other contracts interact with to get the 'Profile' information needed to
/// interact with the Allo protocol. The Registry is also used to create new profiles
/// and update existing profiles. The Registry is also used to add and remove members
/// from a profile. The Registry will not always be used in a strategy and will depend on
/// the strategy being used.
interface IRegistry {
/// ======================
/// ======= Structs ======
/// ======================
/// @dev The Profile struct that all profiles are based from
struct Profile {
bytes32 id;
uint256 nonce;
string name;
Metadata metadata;
address owner;
address anchor;
}
/// ======================
/// ======= Events =======
/// ======================
/// @dev Emitted when a profile is created. This will return your anchor address.
event ProfileCreated(
bytes32 indexed profileId, uint256 nonce, string name, Metadata metadata, address owner, address anchor
);
/// @dev Emitted when a profile name is updated. This will update the anchor when the name is updated and return it.
event ProfileNameUpdated(bytes32 indexed profileId, string name, address anchor);
/// @dev Emitted when a profile's metadata is updated.
event ProfileMetadataUpdated(bytes32 indexed profileId, Metadata metadata);
/// @dev Emitted when a profile owner is updated.
event ProfileOwnerUpdated(bytes32 indexed profileId, address owner);
/// @dev Emitted when a profile pending owner is updated.
event ProfilePendingOwnerUpdated(bytes32 indexed profileId, address pendingOwner);
/// =========================
/// ==== View Functions =====
/// =========================
/// @dev Returns the 'Profile' for a '_profileId' passed
/// @param _profileId The 'profileId' to return the 'Profile' for
/// @return profile The 'Profile' for the '_profileId' passed
function getProfileById(bytes32 _profileId) external view returns (Profile memory profile);
/// @dev Returns the 'Profile' for an '_anchor' passed
/// @param _anchor The 'anchor' to return the 'Profile' for
/// @return profile The 'Profile' for the '_anchor' passed
function getProfileByAnchor(address _anchor) external view returns (Profile memory profile);
/// @dev Returns a boolean if the '_account' is a member or owner of the '_profileId' passed in
/// @param _profileId The 'profileId' to check if the '_account' is a member or owner of
/// @param _account The 'account' to check if they are a member or owner of the '_profileId' passed in
/// @return isOwnerOrMemberOfProfile A boolean if the '_account' is a member or owner of the '_profileId' passed in
function isOwnerOrMemberOfProfile(bytes32 _profileId, address _account)
external
view
returns (bool isOwnerOrMemberOfProfile);
/// @dev Returns a boolean if the '_account' is an owner of the '_profileId' passed in
/// @param _profileId The 'profileId' to check if the '_account' is an owner of
/// @param _owner The 'owner' to check if they are an owner of the '_profileId' passed in
/// @return isOwnerOfProfile A boolean if the '_account' is an owner of the '_profileId' passed in
function isOwnerOfProfile(bytes32 _profileId, address _owner) external view returns (bool isOwnerOfProfile);
/// @dev Returns a boolean if the '_account' is a member of the '_profileId' passed in
/// @param _profileId The 'profileId' to check if the '_account' is a member of
/// @param _member The 'member' to check if they are a member of the '_profileId' passed in
/// @return isMemberOfProfile A boolean if the '_account' is a member of the '_profileId' passed in
function isMemberOfProfile(bytes32 _profileId, address _member) external view returns (bool isMemberOfProfile);
/// ====================================
/// ==== External/Public Functions =====
/// ====================================
/// @dev Creates a new 'Profile' and returns the 'profileId' of the new profile
///
/// Note: The 'name' and 'nonce' are used to generate the 'anchor' address
///
/// Requirements: None, anyone can create a new profile
///
/// @param _nonce The nonce to use to generate the 'anchor' address
/// @param _name The name to use to generate the 'anchor' address
/// @param _metadata The 'Metadata' to use to generate the 'anchor' address
/// @param _owner The 'owner' to use to generate the 'anchor' address
/// @param _members The 'members' to use to generate the 'anchor' address
/// @return profileId The 'profileId' of the new profile
function createProfile(
uint256 _nonce,
string memory _name,
Metadata memory _metadata,
address _owner,
address[] memory _members
) external returns (bytes32 profileId);
/// @dev Updates the 'name' of the '_profileId' passed in and returns the new 'anchor' address
///
/// Requirements: Only the 'Profile' owner can update the name
///
/// Note: The 'name' and 'nonce' are used to generate the 'anchor' address and this will update the 'anchor'
/// so please use caution. You can always recreate your 'anchor' address by updating the name back
/// to the original name used to create the profile.
///
/// @param _profileId The 'profileId' to update the name for
/// @param _name The new 'name' value
/// @return anchor The new 'anchor' address
function updateProfileName(bytes32 _profileId, string memory _name) external returns (address anchor);
/// @dev Updates the 'Metadata' of the '_profileId' passed in
///
/// Requirements: Only the 'Profile' owner can update the metadata
///
/// @param _profileId The 'profileId' to update the metadata for
/// @param _metadata The new 'Metadata' value
function updateProfileMetadata(bytes32 _profileId, Metadata memory _metadata) external;
/// @dev Updates the pending 'owner' of the '_profileId' passed in
///
/// Requirements: Only the 'Profile' owner can update the pending owner
///
/// @param _profileId The 'profileId' to update the pending owner for
/// @param _pendingOwner The new pending 'owner' value
function updateProfilePendingOwner(bytes32 _profileId, address _pendingOwner) external;
/// @dev Accepts the pending 'owner' of the '_profileId' passed in
///
/// Requirements: Only the pending owner can accept the ownership
///
/// @param _profileId The 'profileId' to accept the ownership for
function acceptProfileOwnership(bytes32 _profileId) external;
/// @dev Adds members to the '_profileId' passed in
///
/// Requirements: Only the 'Profile' owner can add members
///
/// @param _profileId The 'profileId' to add members to
/// @param _members The members to add to the '_profileId' passed in
function addMembers(bytes32 _profileId, address[] memory _members) external;
/// @dev Removes members from the '_profileId' passed in
///
/// Requirements: Only the 'Profile' owner can remove members
///
/// @param _profileId The 'profileId' to remove members from
/// @param _members The members to remove from the '_profileId' passed in
function removeMembers(bytes32 _profileId, address[] memory _members) external;
/// @dev Recovers funds from the contract
///
/// Requirements: Must be the Allo owner
///
/// @param _token The token you want to use to recover funds
/// @param _recipient The recipient of the recovered funds
function recoverFunds(address _token, address _recipient) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "./IArbitrator.sol";
/// @title IArbitrable
/// @notice Arbitrable interface.
/// @dev When developing arbitrable contracts, we need to:
/// - Define the action taken when a ruling is received by the contract.
/// - Allow dispute creation. For this a function must call arbitrator.createDispute{value: _fee}(_choices,_extraData);
interface IArbitrable {
/// @dev To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.
/// @param _arbitrator The arbitrator of the contract.
/// @param _arbitrableDisputeID The identifier of the dispute in the Arbitrable contract.
/// @param _externalDisputeID An identifier created outside Kleros by the protocol requesting arbitration.
/// @param _templateId The identifier of the dispute template. Should not be used with _templateUri.
/// @param _templateUri The URI to the dispute template. For example on IPFS: starting with '/ipfs/'. Should not be used with _templateId.
event DisputeRequest(
IArbitrator indexed _arbitrator,
uint256 indexed _arbitrableDisputeID,
uint256 _externalDisputeID,
uint256 _templateId,
string _templateUri
);
/// @dev To be raised when a ruling is given.
/// @param _arbitrator The arbitrator giving the ruling.
/// @param _disputeID The identifier of the dispute in the Arbitrator contract.
/// @param _ruling The ruling which was given.
event Ruling(IArbitrator indexed _arbitrator, uint256 indexed _disputeID, uint256 _ruling);
/// @dev Give a ruling for a dispute.
/// Must be called by the arbitrator.
/// The purpose of this function is to ensure that the address calling it has the right to rule on the contract.
/// @param _disputeID The identifier of the dispute in the Arbitrator contract.
/// @param _ruling Ruling given by the arbitrator.
/// Note that 0 is reserved for "Not able/wanting to make a decision".
function rule(uint256 _disputeID, uint256 _ruling) external;
}// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.19; // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⢿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⡟⠘⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ // ⠀⠀⠀⠀⠀⠀⠀⠀⣀⣴⣾⣿⣿⣿⣿⣾⠻⣿⣿⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⡿⠀⠀⠸⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠀⠀⢀⣠⣴⣴⣶⣶⣶⣦⣦⣀⡀⠀⠀⠀⠀⠀⠀ // ⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⣿⣿⣿⣿⡿⠃⠀⠙⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⠁⠀⠀⠀⢻⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⡀⠀⠀⠀⠀ // ⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀⠘⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⠃⠀⠀⠀⠀⠈⢿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⣰⣿⣿⣿⡿⠋⠁⠀⠀⠈⠘⠹⣿⣿⣿⣿⣆⠀⠀⠀ // ⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠈⢿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⢰⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⡀⠀⠀ // ⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣟⠀⡀⢀⠀⡀⢀⠀⡀⢈⢿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⡇⠀⠀ // ⠀⠀⣠⣿⣿⣿⣿⣿⣿⡿⠋⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣶⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⡿⢿⠿⠿⠿⠿⠿⠿⠿⠿⠿⢿⣿⣿⣿⣷⡀⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠸⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⠂⠀⠀ // ⠀⠀⠙⠛⠿⠻⠻⠛⠉⠀⠀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⣿⣿⣿⣧⠀⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⢻⣿⣿⣿⣷⣀⢀⠀⠀⠀⡀⣰⣾⣿⣿⣿⠏⠀⠀⠀ // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣧⠀⠀⢸⣿⣿⣿⣗⠀⠀⠀⢸⣿⣿⣿⡯⠀⠀⠀⠀⠹⢿⣿⣿⣿⣿⣾⣾⣷⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀ // ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠙⠋⠛⠙⠋⠛⠙⠋⠛⠙⠋⠃⠀⠀⠀⠀⠀⠀⠀⠀⠠⠿⠻⠟⠿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠟⠿⠟⠿⠆⠀⠸⠿⠿⠟⠯⠀⠀⠀⠸⠿⠿⠿⠏⠀⠀⠀⠀⠀⠈⠉⠻⠻⡿⣿⢿⡿⡿⠿⠛⠁⠀⠀⠀⠀⠀⠀ // allo.gitcoin.co /// @title Metadata /// @author @thelostone-mc <[email protected]>, @0xKurt <[email protected]>, @codenamejason <[email protected]>, @0xZakk <[email protected]>, @nfrgosselin <[email protected]> /// @notice Metadata is used to define the metadata for the protocol that is used throughout the system. struct Metadata { /// @notice Protocol ID corresponding to a specific protocol (currently using IPFS = 1) uint256 protocol; /// @notice Pointer (hash) to fetch metadata for the specified protocol string pointer; }
{
"remappings": [
"allo-v2/=lib/allo-v2/",
"allo-v2-contracts/=lib/allo-v2/contracts/",
"allo-v2-test/=lib/allo-v2/test/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin/foundry/=lib/openzeppelin-foundry-upgrades/src/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@superfluid-finance/=lib/protocol-monorepo/packages/",
"@src/=pkg/contracts/src/",
"solady/=lib/allo-v2/lib/solady/src/",
"@prb/math/=lib/allo-v2/lib/v2-core/lib/prb-math/",
"@prb/test/=lib/allo-v2/lib/v2-core/lib/prb-test/src/",
"@sablier/v2-core/=lib/allo-v2/lib/v2-core/",
"ERC1155/=lib/allo-v2/lib/hats-protocol/lib/ERC1155/",
"__safe-smart-account/=lib/__safe-smart-account/",
"ds-test/=lib/allo-v2/lib/forge-std/lib/ds-test/src/",
"eas-contracts/=lib/allo-v2/lib/eas-contracts/contracts/",
"eas-proxy/=lib/allo-v2/lib/eas-proxy/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"forge-gas-snapshot/=lib/allo-v2/lib/permit2/lib/forge-gas-snapshot/src/",
"forge-std/=lib/forge-std/src/",
"hats-protocol/=lib/allo-v2/lib/hats-protocol/",
"hedgey-vesting/=lib/allo-v2/lib/hedgey-vesting/contracts/",
"lib/ERC1155/=lib/allo-v2/lib/hats-protocol/lib/ERC1155/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"openzeppelin/=lib/openzeppelin-contracts/contracts/",
"permit2/=lib/allo-v2/lib/permit2/",
"prb-math/=lib/allo-v2/lib/v2-core/lib/prb-math/src/",
"prb-test/=lib/allo-v2/lib/v2-core/lib/prb-test/src/",
"protocol-monorepo/=lib/protocol-monorepo/packages/solidity-semantic-money/src/",
"safe-smart-account/=lib/safe-smart-account/",
"solarray/=lib/allo-v2/lib/v2-core/lib/solarray/src/",
"solbase/=lib/allo-v2/lib/hats-protocol/lib/solbase/src/",
"solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/",
"solmate/=lib/allo-v2/lib/permit2/lib/solmate/",
"superfluid-protocol-monorepo/=lib/allo-v2/lib/superfluid-protocol-monorepo/packages/solidity-semantic-money/src/",
"utils/=lib/allo-v2/lib/hats-protocol/lib/utils/",
"v2-core/=lib/allo-v2/lib/v2-core/"
],
"optimizer": {
"enabled": true,
"runs": 0
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false
}Contract ABI
API[{"inputs":[],"name":"D","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_timePassed","type":"uint256"},{"internalType":"uint256","name":"_lastConv","type":"uint256"},{"internalType":"uint256","name":"_oldAmount","type":"uint256"},{"internalType":"uint256","name":"_decay","type":"uint256"}],"name":"calculateConviction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_requestedAmount","type":"uint256"},{"internalType":"uint256","name":"_poolAmount","type":"uint256"},{"internalType":"uint256","name":"_totalPointsActivated","type":"uint256"},{"internalType":"uint256","name":"_decay","type":"uint256"},{"internalType":"uint256","name":"_weight","type":"uint256"},{"internalType":"uint256","name":"_maxRatio","type":"uint256"},{"internalType":"uint256","name":"_minThresholdPoints","type":"uint256"}],"name":"calculateThreshold","outputs":[{"internalType":"uint256","name":"_threshold","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"_decay","type":"uint256"}],"name":"getMaxConviction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"}]Contract Creation Code
61040e61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c8063010dfe641461005b5780630f529ba21461008057806329dfe5ba1461008a5780639bcb99c41461009d575b600080fd5b61006e6100693660046102ec565b6100b0565b60405190815260200160405180910390f35b61006e6298968081565b61006e61009836600461031e565b61013e565b61006e6100ab36600461036a565b610244565b600084816100ce6100c862989680608087901b6103a2565b83610273565b905060806001607f1b6100e486629896806103c4565b6100f284600160801b6103c4565b6100ff629896808a6103d7565b61010991906103d7565b61011391906103a2565b61011d89856103d7565b61012791906103ee565b61013191906103ee565b901c979650505050505050565b600080876101508a600160401b6103d7565b61015a91906103a2565b6298968061016c86600160401b6103d7565b61017691906103a2565b61018091906103c4565b905060408761019288629896806103c4565b6298968060406101a286806103d7565b901c6101b56298968060808c901b6103a2565b6101bf91906103a2565b6101c991906103d7565b6101d391906103a2565b6101dd91906103d7565b901c9150861561023857600062989680886101f88a8a610244565b61020562989680886103d7565b61020f91906103d7565b61021991906103a2565b61022391906103a2565b90508083116102325780610234565b825b9250505b50979650505050505050565b600061025382629896806103c4565b61026062989680856103d7565b61026a91906103a2565b90505b92915050565b600160801b82825b80156102be57806001166000036102a05761029682836102c6565b915060011c61027b565b6102aa83836102c6565b92506102b76001826103c4565b905061027b565b505092915050565b600060806001607f1b6102d984866103d7565b6102e391906103ee565b901c9392505050565b6000806000806080858703121561030257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600080600080600060e0888a03121561033957600080fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b6000806040838503121561037d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b6000826103bf57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561026d5761026d61038c565b808202811582820484141761026d5761026d61038c565b8082018082111561026d5761026d61038c56fea164736f6c6343000813000a
Deployed Bytecode
0x73a7974afe89a3b04af38cb6fe59d2a10eb997b8bd30146080604052600436106100565760003560e01c8063010dfe641461005b5780630f529ba21461008057806329dfe5ba1461008a5780639bcb99c41461009d575b600080fd5b61006e6100693660046102ec565b6100b0565b60405190815260200160405180910390f35b61006e6298968081565b61006e61009836600461031e565b61013e565b61006e6100ab36600461036a565b610244565b600084816100ce6100c862989680608087901b6103a2565b83610273565b905060806001607f1b6100e486629896806103c4565b6100f284600160801b6103c4565b6100ff629896808a6103d7565b61010991906103d7565b61011391906103a2565b61011d89856103d7565b61012791906103ee565b61013191906103ee565b901c979650505050505050565b600080876101508a600160401b6103d7565b61015a91906103a2565b6298968061016c86600160401b6103d7565b61017691906103a2565b61018091906103c4565b905060408761019288629896806103c4565b6298968060406101a286806103d7565b901c6101b56298968060808c901b6103a2565b6101bf91906103a2565b6101c991906103d7565b6101d391906103a2565b6101dd91906103d7565b901c9150861561023857600062989680886101f88a8a610244565b61020562989680886103d7565b61020f91906103d7565b61021991906103a2565b61022391906103a2565b90508083116102325780610234565b825b9250505b50979650505050505050565b600061025382629896806103c4565b61026062989680856103d7565b61026a91906103a2565b90505b92915050565b600160801b82825b80156102be57806001166000036102a05761029682836102c6565b915060011c61027b565b6102aa83836102c6565b92506102b76001826103c4565b905061027b565b505092915050565b600060806001607f1b6102d984866103d7565b6102e391906103ee565b901c9392505050565b6000806000806080858703121561030257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600080600080600060e0888a03121561033957600080fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b6000806040838503121561037d57600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b6000826103bf57634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561026d5761026d61038c565b808202811582820484141761026d5761026d61038c565b8082018082111561026d5761026d61038c56fea164736f6c6343000813000a
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.