Transactions
Token Transfers
Tokens
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- EqualAllocationVault
- Optimization enabled
- false
- Compiler version
- v0.8.24+commit.e11b9ed9
- EVM Version
- Verified at
- 2026-09-19T09:39:03.526854Z
Constructor Arguments
0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000e2cd49e38aae5a36839c7009690e480c1d9ca620
Arg [0] (uint8) : 4
Arg [1] (address) : 0xe2cd49e38aae5a36839c7009690e480c1d9ca620
src/EqualAllocationVault.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { Equal } from "./Equal.sol";
/// @title EQUAL Allocation Vault
/// @notice Canonically bounded custody for one EQUAL genesis allocation domain.
/// @dev Deployed once per canonical allocation type. The bootstrap authority may
/// bind the canonical EQUAL token and final release authority exactly once.
/// After initialization the bootstrap authority has no release capability.
contract EqualAllocationVault {
using SafeERC20 for IERC20;
uint256 public constant TOKEN_UNIT = 10 ** 18;
uint256 public constant CANONICAL_MAX_SUPPLY = 1_000_000_000 * TOKEN_UNIT;
uint256 public constant EMISSION_VAULT_CAP = 800_000_000 * TOKEN_UNIT;
uint256 public constant POL_CAP = 60_000_000 * TOKEN_UNIT;
uint256 public constant TREASURY_SECURITY_CAP = 40_000_000 * TOKEN_UNIT;
uint256 public constant ECOSYSTEM_CAP = 40_000_000 * TOKEN_UNIT;
uint256 public constant MARKET_EXCHANGE_CAP = 30_000_000 * TOKEN_UNIT;
uint256 public constant CONTRIBUTOR_CAP = 30_000_000 * TOKEN_UNIT;
error EqualAllocationVaultZeroBootstrapAuthority();
error EqualAllocationVaultUnauthorizedBootstrap(address caller);
error EqualAllocationVaultAlreadyInitialized();
error EqualAllocationVaultZeroToken();
error EqualAllocationVaultZeroReleaseAuthority();
error EqualAllocationVaultBootstrapCannotRemainReleaseAuthority();
error EqualAllocationVaultInvalidTokenAuthority();
error EqualAllocationVaultFundingMismatch(uint256 expected, uint256 actual);
error EqualAllocationVaultNotInitialized();
error EqualAllocationVaultUnauthorizedRelease(address caller);
error EqualAllocationVaultZeroRecipient();
error EqualAllocationVaultZeroAmount();
error EqualAllocationVaultCapExceeded(uint256 cap, uint256 attemptedReleased);
Equal.GenesisAllocationType public immutable allocationType;
uint256 public immutable allocationCap;
address public immutable bootstrapAuthority;
Equal public token;
address public releaseAuthority;
uint256 public released;
bool public initialized;
event AllocationVaultInitialized(
Equal.GenesisAllocationType indexed allocationType,
address indexed token,
address indexed releaseAuthority,
uint256 allocationCap
);
event AllocationReleased(
Equal.GenesisAllocationType indexed allocationType,
address indexed recipient,
uint256 amount,
uint256 cumulativeReleased,
uint256 remainingAllocation
);
constructor(
Equal.GenesisAllocationType allocationType_,
address bootstrapAuthority_
) {
if (bootstrapAuthority_ == address(0)) {
revert EqualAllocationVaultZeroBootstrapAuthority();
}
allocationType = allocationType_;
allocationCap = _canonicalAllocationCap(allocationType_);
bootstrapAuthority = bootstrapAuthority_;
}
/// @notice One-time binding of the canonical EQUAL token and final authority.
/// @dev The vault must already contain exactly its canonical genesis allocation.
function initialize(
Equal token_,
address releaseAuthority_
) external {
if (msg.sender != bootstrapAuthority) {
revert EqualAllocationVaultUnauthorizedBootstrap(msg.sender);
}
if (initialized) {
revert EqualAllocationVaultAlreadyInitialized();
}
if (address(token_) == address(0)) {
revert EqualAllocationVaultZeroToken();
}
if (releaseAuthority_ == address(0)) {
revert EqualAllocationVaultZeroReleaseAuthority();
}
if (releaseAuthority_ == bootstrapAuthority) {
revert EqualAllocationVaultBootstrapCannotRemainReleaseAuthority();
}
if (
token_.MAX_SUPPLY() != CANONICAL_MAX_SUPPLY
|| token_.totalSupply() != CANONICAL_MAX_SUPPLY || token_.TRANSFER_TAX_BPS() != 0
) {
revert EqualAllocationVaultInvalidTokenAuthority();
}
uint256 fundedBalance = token_.balanceOf(address(this));
if (fundedBalance != allocationCap) {
revert EqualAllocationVaultFundingMismatch(allocationCap, fundedBalance);
}
token = token_;
releaseAuthority = releaseAuthority_;
initialized = true;
emit AllocationVaultInitialized(
allocationType, address(token_), releaseAuthority_, allocationCap
);
}
/// @notice Releases EQUAL within the immutable canonical allocation cap.
/// @dev State is advanced before the fixed EQUAL token transfer.
function release(
address recipient,
uint256 amount
) external {
if (!initialized) {
revert EqualAllocationVaultNotInitialized();
}
if (msg.sender != releaseAuthority) {
revert EqualAllocationVaultUnauthorizedRelease(msg.sender);
}
if (recipient == address(0)) {
revert EqualAllocationVaultZeroRecipient();
}
if (amount == 0) {
revert EqualAllocationVaultZeroAmount();
}
uint256 cumulativeReleased = released + amount;
if (cumulativeReleased > allocationCap) {
revert EqualAllocationVaultCapExceeded(allocationCap, cumulativeReleased);
}
released = cumulativeReleased;
IERC20(address(token)).safeTransfer(recipient, amount);
emit AllocationReleased(
allocationType,
recipient,
amount,
cumulativeReleased,
allocationCap - cumulativeReleased
);
}
function remainingAllocation() external view returns (uint256) {
return allocationCap - released;
}
function _canonicalAllocationCap(
Equal.GenesisAllocationType allocationType_
) internal pure returns (uint256) {
if (allocationType_ == Equal.GenesisAllocationType.EmissionVault) {
return EMISSION_VAULT_CAP;
}
if (allocationType_ == Equal.GenesisAllocationType.ProtocolOwnedLiquidity) {
return POL_CAP;
}
if (allocationType_ == Equal.GenesisAllocationType.TreasurySecurity) {
return TREASURY_SECURITY_CAP;
}
if (allocationType_ == Equal.GenesisAllocationType.Ecosystem) {
return ECOSYSTEM_CAP;
}
if (allocationType_ == Equal.GenesisAllocationType.MarketExchange) {
return MARKET_EXCHANGE_CAP;
}
return CONTRIBUTOR_CAP;
}
}
lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity >=0.6.2;
import {IERC20} from "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)
pragma solidity >=0.4.16;
import {IERC20} from "../token/ERC20/IERC20.sol";
lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)
pragma solidity >=0.6.2;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}
lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)
pragma solidity >=0.4.16;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}
lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.7.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
import {IERC20Metadata} from "../../../interfaces/IERC20Metadata.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
if (!_safeTransfer(token, to, value, true)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
if (!_safeTransferFrom(token, from, to, value, true)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _safeTransfer(token, to, value, false);
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _safeTransferFrom(token, from, to, value, false);
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
if (!_safeApprove(token, spender, value, false)) {
if (!_safeApprove(token, spender, 0, true)) revert SafeERC20FailedOperation(address(token));
if (!_safeApprove(token, spender, value, true)) revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Oppositely, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/// @dev Attempts to fetch the token decimals. A return value of false indicates that the attempt failed in some way.
function tryGetDecimals(IERC20 token) internal view returns (bool success, uint8 decimals) {
bytes4 selector = IERC20Metadata.decimals.selector;
assembly ("memory-safe") {
mstore(0x00, selector)
success := staticcall(gas(), token, 0x00, 4, 0x00, 0x20)
success := and(and(success, gt(returndatasize(), 0x1f)), lt(mload(0x00), 0x100))
decimals := mul(success, mload(0x00))
}
}
/**
* @dev Imitates a Solidity `token.transfer(to, value)` call, relaxing the requirement on the return value: the
* return value is optional (but if data is returned, it must not be false).
*
* @param token The token targeted by the call.
* @param to The recipient of the tokens
* @param value The amount of token to transfer
* @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
*/
function _safeTransfer(IERC20 token, address to, uint256 value, bool bubble) private returns (bool success) {
bytes4 selector = IERC20.transfer.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(to, shr(96, not(0))))
mstore(0x24, value)
success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
}
}
/**
* @dev Imitates a Solidity `token.transferFrom(from, to, value)` call, relaxing the requirement on the return
* value: the return value is optional (but if data is returned, it must not be false).
*
* @param token The token targeted by the call.
* @param from The sender of the tokens
* @param to The recipient of the tokens
* @param value The amount of token to transfer
* @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
*/
function _safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value,
bool bubble
) private returns (bool success) {
bytes4 selector = IERC20.transferFrom.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(from, shr(96, not(0))))
mstore(0x24, and(to, shr(96, not(0))))
mstore(0x44, value)
success := call(gas(), token, 0, 0x00, 0x64, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
mstore(0x60, 0)
}
}
/**
* @dev Imitates a Solidity `token.approve(spender, value)` call, relaxing the requirement on the return value:
* the return value is optional (but if data is returned, it must not be false).
*
* @param token The token targeted by the call.
* @param spender The spender of the tokens
* @param value The amount of token to approve
* @param bubble Behavior switch if the approve call reverts: bubble the revert reason or return a false boolean.
*/
function _safeApprove(IERC20 token, address spender, uint256 value, bool bubble) private returns (bool success) {
bytes4 selector = IERC20.approve.selector;
assembly ("memory-safe") {
let fmp := mload(0x40)
mstore(0x00, selector)
mstore(0x04, and(spender, shr(96, not(0))))
mstore(0x24, value)
success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
// if call success and return is true, all is good.
// otherwise (not success or return is not true), we need to perform further checks
if iszero(and(success, eq(mload(0x00), 1))) {
// if the call was a failure and bubble is enabled, bubble the error
if and(iszero(success), bubble) {
returndatacopy(fmp, 0x00, returndatasize())
revert(fmp, returndatasize())
}
// if the return value is not true, then the call is only successful if:
// - the token address has code
// - the returndata is empty
success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
}
mstore(0x40, fmp)
}
}
}
lib/openzeppelin-contracts/contracts/interfaces/IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20Metadata.sol)
pragma solidity >=0.6.2;
import {IERC20Metadata} from "../token/ERC20/extensions/IERC20Metadata.sol";
lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC-20
* applications.
*/
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) private _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* Both values are immutable: they can only be set once during construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/// @inheritdoc IERC20
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
/// @inheritdoc IERC20
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/// @inheritdoc IERC20
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Skips emitting an {Approval} event indicating an allowance update. This is not
* required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner`'s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation sets the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the `transferFrom` operation can force the flag to
* true using the following override:
*
* ```solidity
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner`'s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance < type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}
lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (interfaces/draft-IERC6093.sol)
pragma solidity >=0.8.4;
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-721.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
src/Equal.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
/// @title Equilibrium (EQUAL)
/// @notice Immutable fixed-supply token core for the Vitality Trinity.
/// @dev No owner, administrator, post-constructor mint, proxy, pause, or transfer tax.
contract Equal is ERC20 {
uint256 public constant TOKEN_UNIT = 10 ** 18;
uint256 public constant MAX_SUPPLY = 1_000_000_000 * TOKEN_UNIT;
uint256 public constant EMISSION_VAULT_ALLOCATION = 800_000_000 * TOKEN_UNIT;
uint256 public constant POL_ALLOCATION = 60_000_000 * TOKEN_UNIT;
uint256 public constant TREASURY_SECURITY_ALLOCATION = 40_000_000 * TOKEN_UNIT;
uint256 public constant ECOSYSTEM_ALLOCATION = 40_000_000 * TOKEN_UNIT;
uint256 public constant MARKET_EXCHANGE_ALLOCATION = 30_000_000 * TOKEN_UNIT;
uint256 public constant CONTRIBUTOR_ALLOCATION = 30_000_000 * TOKEN_UNIT;
uint256 public constant TRANSFER_TAX_BPS = 0;
enum GenesisAllocationType {
EmissionVault,
ProtocolOwnedLiquidity,
TreasurySecurity,
Ecosystem,
MarketExchange,
Contributor
}
error EqualZeroAllocationRecipient(uint8 allocationType);
error EqualDuplicateAllocationRecipient(uint8 firstAllocationType, uint8 secondAllocationType);
event GenesisAllocation(
GenesisAllocationType indexed allocationType, address indexed recipient, uint256 amount
);
constructor(
address emissionVault,
address protocolOwnedLiquidity,
address treasurySecurity,
address ecosystem,
address marketExchange,
address contributor
) ERC20("Equilibrium", "EQUAL") {
address[6] memory recipients = [
emissionVault,
protocolOwnedLiquidity,
treasurySecurity,
ecosystem,
marketExchange,
contributor
];
uint256[6] memory amounts = [
EMISSION_VAULT_ALLOCATION,
POL_ALLOCATION,
TREASURY_SECURITY_ALLOCATION,
ECOSYSTEM_ALLOCATION,
MARKET_EXCHANGE_ALLOCATION,
CONTRIBUTOR_ALLOCATION
];
for (uint256 i = 0; i < recipients.length; ++i) {
if (recipients[i] == address(0)) {
revert EqualZeroAllocationRecipient(uint8(i));
}
for (uint256 j = 0; j < i; ++j) {
if (recipients[i] == recipients[j]) {
revert EqualDuplicateAllocationRecipient(uint8(j), uint8(i));
}
}
_mint(recipients[i], amounts[i]);
emit GenesisAllocation(GenesisAllocationType(i), recipients[i], amounts[i]);
}
assert(totalSupply() == MAX_SUPPLY);
}
}
lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)
pragma solidity >=0.4.16;
import {IERC165} from "../utils/introspection/IERC165.sol";
lib/openzeppelin-contracts/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
Compiler Settings
{"viaIR":false,"remappings":["@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","forge-std/=lib/openzeppelin-contracts/lib/forge-std/src/","halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/","openzeppelin-contracts/=lib/openzeppelin-contracts/"],"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":false,"bytecodeHash":"none","appendCBOR":true},"libraries":{},"evmVersion":"paris"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"uint8","name":"allocationType_","internalType":"enum Equal.GenesisAllocationType"},{"type":"address","name":"bootstrapAuthority_","internalType":"address"}]},{"type":"error","name":"EqualAllocationVaultAlreadyInitialized","inputs":[]},{"type":"error","name":"EqualAllocationVaultBootstrapCannotRemainReleaseAuthority","inputs":[]},{"type":"error","name":"EqualAllocationVaultCapExceeded","inputs":[{"type":"uint256","name":"cap","internalType":"uint256"},{"type":"uint256","name":"attemptedReleased","internalType":"uint256"}]},{"type":"error","name":"EqualAllocationVaultFundingMismatch","inputs":[{"type":"uint256","name":"expected","internalType":"uint256"},{"type":"uint256","name":"actual","internalType":"uint256"}]},{"type":"error","name":"EqualAllocationVaultInvalidTokenAuthority","inputs":[]},{"type":"error","name":"EqualAllocationVaultNotInitialized","inputs":[]},{"type":"error","name":"EqualAllocationVaultUnauthorizedBootstrap","inputs":[{"type":"address","name":"caller","internalType":"address"}]},{"type":"error","name":"EqualAllocationVaultUnauthorizedRelease","inputs":[{"type":"address","name":"caller","internalType":"address"}]},{"type":"error","name":"EqualAllocationVaultZeroAmount","inputs":[]},{"type":"error","name":"EqualAllocationVaultZeroBootstrapAuthority","inputs":[]},{"type":"error","name":"EqualAllocationVaultZeroRecipient","inputs":[]},{"type":"error","name":"EqualAllocationVaultZeroReleaseAuthority","inputs":[]},{"type":"error","name":"EqualAllocationVaultZeroToken","inputs":[]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"type":"event","name":"AllocationReleased","inputs":[{"type":"uint8","name":"allocationType","internalType":"enum Equal.GenesisAllocationType","indexed":true},{"type":"address","name":"recipient","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"cumulativeReleased","internalType":"uint256","indexed":false},{"type":"uint256","name":"remainingAllocation","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"AllocationVaultInitialized","inputs":[{"type":"uint8","name":"allocationType","internalType":"enum Equal.GenesisAllocationType","indexed":true},{"type":"address","name":"token","internalType":"address","indexed":true},{"type":"address","name":"releaseAuthority","internalType":"address","indexed":true},{"type":"uint256","name":"allocationCap","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"CANONICAL_MAX_SUPPLY","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"CONTRIBUTOR_CAP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ECOSYSTEM_CAP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"EMISSION_VAULT_CAP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MARKET_EXCHANGE_CAP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"POL_CAP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TOKEN_UNIT","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TREASURY_SECURITY_CAP","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allocationCap","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"enum Equal.GenesisAllocationType"}],"name":"allocationType","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"bootstrapAuthority","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"token_","internalType":"contract Equal"},{"type":"address","name":"releaseAuthority_","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"initialized","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"release","inputs":[{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"releaseAuthority","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"released","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"remainingAllocation","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract Equal"}],"name":"token","inputs":[]}]
Contract Creation Code
0x60e06040523480156200001157600080fd5b5060405162000de738038062000de78339810160408190526200003491620001d4565b6001600160a01b0381166200005c57604051637661d82960e11b815260040160405180910390fd5b81600581111562000071576200007162000221565b608081600581111562000088576200008862000221565b9052506200009682620000ac565b60a0526001600160a01b031660c052506200025d565b600080826005811115620000c457620000c462000221565b03620000e857620000e2670de0b6b3a7640000632faf080062000237565b92915050565b6001826005811115620000ff57620000ff62000221565b036200011d57620000e2670de0b6b3a7640000630393870062000237565b600282600581111562000134576200013462000221565b036200015257620000e2670de0b6b3a76400006302625a0062000237565b600382600581111562000169576200016962000221565b036200018757620000e2670de0b6b3a76400006302625a0062000237565b60048260058111156200019e576200019e62000221565b03620001bc57620000e2670de0b6b3a76400006301c9c38062000237565b620000e2670de0b6b3a76400006301c9c38062000237565b60008060408385031215620001e857600080fd5b825160068110620001f857600080fd5b60208401519092506001600160a01b03811681146200021657600080fd5b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b8082028115828204841417620000e257634e487b7160e01b600052601160045260246000fd5b60805160a05160c051610b0d620002da60003960008181610246015281816104cb015261057f0152600081816101900152818161032c01528181610361015281816104150152818161047c015281816107c2015281816107f6015261089e015260008181610203015281816103bc01526108690152610b0d6000f3fe608060405234801561001057600080fd5b50600436106101165760003560e01c806355f8aec8116100a2578063a5aa94ac11610071578063a5aa94ac146101fe578063a5c9cd8214610232578063ce29a7f914610241578063e3de54ea14610130578063fc0c546a1461026857600080fd5b806355f8aec8146101b257806361816832146101c25780639437e77c146101ed57806396132521146101f557600080fd5b806343f541da116100e957806343f541da14610170578063485cc95514610178578063504e49561461018b578063519b6aa3146101b257806352a7397e146101ba57600080fd5b80630357371d1461011b57806304d2e66a14610130578063158ef93e1461014b5780633dc9dc9c14610168575b600080fd5b61012e6101293660046109eb565b61027b565b005b61013861045c565b6040519081526020015b60405180910390f35b6003546101589060ff1681565b6040519015158152602001610142565b610138610475565b6101386104aa565b61012e610186366004610a17565b6104c0565b6101387f000000000000000000000000000000000000000000000000000000000000000081565b6101386108f1565b610138610907565b6001546101d5906001600160a01b031681565b6040516001600160a01b039091168152602001610142565b61013861091d565b61013860025481565b6102257f000000000000000000000000000000000000000000000000000000000000000081565b6040516101429190610a66565b610138670de0b6b3a764000081565b6101d57f000000000000000000000000000000000000000000000000000000000000000081565b6000546101d5906001600160a01b031681565b60035460ff1661029e576040516312c49eeb60e31b815260040160405180910390fd5b6001546001600160a01b031633146102d05760405163029ce6a360e51b81523360048201526024015b60405180910390fd5b6001600160a01b0382166102f75760405163fbcf44f560e01b815260040160405180910390fd5b806000036103185760405163b52f3b1560e01b815260040160405180910390fd5b6000816002546103289190610aa4565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103945760405163bcb70de160e01b81527f00000000000000000000000000000000000000000000000000000000000000006004820152602481018290526044016102c7565b60028190556000546103b0906001600160a01b03168484610933565b826001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000060058111156103ec576103ec610a50565b7ffa7a1e7b3ffe7bce69aa23e2ea09dd054df2629423087bc840d9376012659ecd8484610439817f0000000000000000000000000000000000000000000000000000000000000000610abd565b6040805193845260208401929092529082015260600160405180910390a3505050565b610472670de0b6b3a76400006301c9c380610ad0565b81565b60006002547f00000000000000000000000000000000000000000000000000000000000000006104a59190610abd565b905090565b610472670de0b6b3a76400006303938700610ad0565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461050b57604051634535ac7960e01b81523360048201526024016102c7565b60035460ff161561052f57604051635a1886cf60e11b815260040160405180910390fd5b6001600160a01b03821661055657604051638b707fe160e01b815260040160405180910390fd5b6001600160a01b03811661057d576040516309b110a160e41b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b0316036105cf5760405163428849e160e01b815260040160405180910390fd5b6105e5670de0b6b3a7640000633b9aca00610ad0565b826001600160a01b03166332cb6b0c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610623573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106479190610ae7565b1415806106ca5750610665670de0b6b3a7640000633b9aca00610ad0565b826001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c79190610ae7565b14155b806107355750816001600160a01b031663a098cbe56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561070e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107329190610ae7565b15155b156107535760405163103365d160e11b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561079a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107be9190610ae7565b90507f000000000000000000000000000000000000000000000000000000000000000081146108295760405163660e894160e11b81527f00000000000000000000000000000000000000000000000000000000000000006004820152602481018290526044016102c7565b600080546001600160a01b038086166001600160a01b031992831681179093556001805491861691909216811782556003805460ff1916909217909155907f0000000000000000000000000000000000000000000000000000000000000000600581111561089957610899610a50565b6040517f000000000000000000000000000000000000000000000000000000000000000081527f9d3a364d28da4b9d25b53e4db0b337a882c69623c9790901a8ffd8c74ca711539060200160405180910390a4505050565b610472670de0b6b3a76400006302625a00610ad0565b610472670de0b6b3a7640000632faf0800610ad0565b610472670de0b6b3a7640000633b9aca00610ad0565b610940838383600161096d565b61096857604051635274afe760e01b81526001600160a01b03841660048201526024016102c7565b505050565b60405163a9059cbb60e01b60008181526001600160a01b038616600452602485905291602083604481808b5af1925060016000511483166109c75783831516156109ba573d6000823e3d81fd5b6000873b113d1516831692505b60405250949350505050565b6001600160a01b03811681146109e857600080fd5b50565b600080604083850312156109fe57600080fd5b8235610a09816109d3565b946020939093013593505050565b60008060408385031215610a2a57600080fd5b8235610a35816109d3565b91506020830135610a45816109d3565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b6020810160068310610a8857634e487b7160e01b600052602160045260246000fd5b91905290565b634e487b7160e01b600052601160045260246000fd5b80820180821115610ab757610ab7610a8e565b92915050565b81810381811115610ab757610ab7610a8e565b8082028115828204841417610ab757610ab7610a8e565b600060208284031215610af957600080fd5b505191905056fea164736f6c6343000818000a0000000000000000000000000000000000000000000000000000000000000004000000000000000000000000e2cd49e38aae5a36839c7009690e480c1d9ca620
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806355f8aec8116100a2578063a5aa94ac11610071578063a5aa94ac146101fe578063a5c9cd8214610232578063ce29a7f914610241578063e3de54ea14610130578063fc0c546a1461026857600080fd5b806355f8aec8146101b257806361816832146101c25780639437e77c146101ed57806396132521146101f557600080fd5b806343f541da116100e957806343f541da14610170578063485cc95514610178578063504e49561461018b578063519b6aa3146101b257806352a7397e146101ba57600080fd5b80630357371d1461011b57806304d2e66a14610130578063158ef93e1461014b5780633dc9dc9c14610168575b600080fd5b61012e6101293660046109eb565b61027b565b005b61013861045c565b6040519081526020015b60405180910390f35b6003546101589060ff1681565b6040519015158152602001610142565b610138610475565b6101386104aa565b61012e610186366004610a17565b6104c0565b6101387f00000000000000000000000000000000000000000018d0bf423c03d8de00000081565b6101386108f1565b610138610907565b6001546101d5906001600160a01b031681565b6040516001600160a01b039091168152602001610142565b61013861091d565b61013860025481565b6102257f000000000000000000000000000000000000000000000000000000000000000481565b6040516101429190610a66565b610138670de0b6b3a764000081565b6101d57f000000000000000000000000e2cd49e38aae5a36839c7009690e480c1d9ca62081565b6000546101d5906001600160a01b031681565b60035460ff1661029e576040516312c49eeb60e31b815260040160405180910390fd5b6001546001600160a01b031633146102d05760405163029ce6a360e51b81523360048201526024015b60405180910390fd5b6001600160a01b0382166102f75760405163fbcf44f560e01b815260040160405180910390fd5b806000036103185760405163b52f3b1560e01b815260040160405180910390fd5b6000816002546103289190610aa4565b90507f00000000000000000000000000000000000000000018d0bf423c03d8de0000008111156103945760405163bcb70de160e01b81527f00000000000000000000000000000000000000000018d0bf423c03d8de0000006004820152602481018290526044016102c7565b60028190556000546103b0906001600160a01b03168484610933565b826001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000460058111156103ec576103ec610a50565b7ffa7a1e7b3ffe7bce69aa23e2ea09dd054df2629423087bc840d9376012659ecd8484610439817f00000000000000000000000000000000000000000018d0bf423c03d8de000000610abd565b6040805193845260208401929092529082015260600160405180910390a3505050565b610472670de0b6b3a76400006301c9c380610ad0565b81565b60006002547f00000000000000000000000000000000000000000018d0bf423c03d8de0000006104a59190610abd565b905090565b610472670de0b6b3a76400006303938700610ad0565b336001600160a01b037f000000000000000000000000e2cd49e38aae5a36839c7009690e480c1d9ca620161461050b57604051634535ac7960e01b81523360048201526024016102c7565b60035460ff161561052f57604051635a1886cf60e11b815260040160405180910390fd5b6001600160a01b03821661055657604051638b707fe160e01b815260040160405180910390fd5b6001600160a01b03811661057d576040516309b110a160e41b815260040160405180910390fd5b7f000000000000000000000000e2cd49e38aae5a36839c7009690e480c1d9ca6206001600160a01b0316816001600160a01b0316036105cf5760405163428849e160e01b815260040160405180910390fd5b6105e5670de0b6b3a7640000633b9aca00610ad0565b826001600160a01b03166332cb6b0c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610623573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106479190610ae7565b1415806106ca5750610665670de0b6b3a7640000633b9aca00610ad0565b826001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c79190610ae7565b14155b806107355750816001600160a01b031663a098cbe56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561070e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107329190610ae7565b15155b156107535760405163103365d160e11b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561079a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107be9190610ae7565b90507f00000000000000000000000000000000000000000018d0bf423c03d8de00000081146108295760405163660e894160e11b81527f00000000000000000000000000000000000000000018d0bf423c03d8de0000006004820152602481018290526044016102c7565b600080546001600160a01b038086166001600160a01b031992831681179093556001805491861691909216811782556003805460ff1916909217909155907f0000000000000000000000000000000000000000000000000000000000000004600581111561089957610899610a50565b6040517f00000000000000000000000000000000000000000018d0bf423c03d8de00000081527f9d3a364d28da4b9d25b53e4db0b337a882c69623c9790901a8ffd8c74ca711539060200160405180910390a4505050565b610472670de0b6b3a76400006302625a00610ad0565b610472670de0b6b3a7640000632faf0800610ad0565b610472670de0b6b3a7640000633b9aca00610ad0565b610940838383600161096d565b61096857604051635274afe760e01b81526001600160a01b03841660048201526024016102c7565b505050565b60405163a9059cbb60e01b60008181526001600160a01b038616600452602485905291602083604481808b5af1925060016000511483166109c75783831516156109ba573d6000823e3d81fd5b6000873b113d1516831692505b60405250949350505050565b6001600160a01b03811681146109e857600080fd5b50565b600080604083850312156109fe57600080fd5b8235610a09816109d3565b946020939093013593505050565b60008060408385031215610a2a57600080fd5b8235610a35816109d3565b91506020830135610a45816109d3565b809150509250929050565b634e487b7160e01b600052602160045260246000fd5b6020810160068310610a8857634e487b7160e01b600052602160045260246000fd5b91905290565b634e487b7160e01b600052601160045260246000fd5b80820180821115610ab757610ab7610a8e565b92915050565b81810381811115610ab757610ab7610a8e565b8082028115828204841417610ab757610ab7610a8e565b600060208284031215610af957600080fd5b505191905056fea164736f6c6343000818000a