Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 248 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Claim Match Payo... | 14518503 | 1421 days ago | IN | 0 ETH | 0.00243527 | ||||
| Claim Match Payo... | 14518503 | 1421 days ago | IN | 0 ETH | 0.00210681 | ||||
| Claim Match Payo... | 14498320 | 1424 days ago | IN | 0 ETH | 0.00309319 | ||||
| Claim Match Payo... | 14481758 | 1427 days ago | IN | 0 ETH | 0.00234479 | ||||
| Claim Match Payo... | 14480436 | 1427 days ago | IN | 0 ETH | 0.00108901 | ||||
| Claim Match Payo... | 14480427 | 1427 days ago | IN | 0 ETH | 0.00126026 | ||||
| Claim Match Payo... | 14474638 | 1428 days ago | IN | 0 ETH | 0.00146521 | ||||
| Claim Match Payo... | 14454700 | 1431 days ago | IN | 0 ETH | 0.001054 | ||||
| Claim Match Payo... | 14450393 | 1432 days ago | IN | 0 ETH | 0.00374992 | ||||
| Claim Match Payo... | 14446851 | 1432 days ago | IN | 0 ETH | 0.00122031 | ||||
| Claim Match Payo... | 14445878 | 1432 days ago | IN | 0 ETH | 0.00263079 | ||||
| Claim Match Payo... | 14443915 | 1433 days ago | IN | 0 ETH | 0.00222588 | ||||
| Claim Match Payo... | 14443892 | 1433 days ago | IN | 0 ETH | 0.00212888 | ||||
| Claim Match Payo... | 14443718 | 1433 days ago | IN | 0 ETH | 0.00289309 | ||||
| Claim Match Payo... | 14442709 | 1433 days ago | IN | 0 ETH | 0.00078298 | ||||
| Claim Match Payo... | 14441102 | 1433 days ago | IN | 0 ETH | 0.00113824 | ||||
| Claim Match Payo... | 14439353 | 1434 days ago | IN | 0 ETH | 0.00138466 | ||||
| Claim Match Payo... | 14438675 | 1434 days ago | IN | 0 ETH | 0.00218484 | ||||
| Claim Match Payo... | 14438538 | 1434 days ago | IN | 0 ETH | 0.0023617 | ||||
| Claim Match Payo... | 14438136 | 1434 days ago | IN | 0 ETH | 0.00233217 | ||||
| Claim Match Payo... | 14437902 | 1434 days ago | IN | 0 ETH | 0.00202889 | ||||
| Claim Match Payo... | 14437375 | 1434 days ago | IN | 0 ETH | 0.00249688 | ||||
| Claim Match Payo... | 14436611 | 1434 days ago | IN | 0 ETH | 0.001071 | ||||
| Claim Match Payo... | 14436130 | 1434 days ago | IN | 0 ETH | 0.00074302 | ||||
| Claim Match Payo... | 14434746 | 1434 days ago | IN | 0 ETH | 0.00106038 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MatchPayouts
Compiler Version
v0.7.5+commit.eb77ed08
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.7.5;
pragma abicoder v2;
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
/**
* @dev This contract allows for non-custodial Gitcoin Grants match payouts. It works as follows:
* 1. During a matching round, deploy a new instance of this contract
* 2. Once the round is complete, Gitcoin computes the final match amounts earned by each grant
* 3. Over the course of multiple transactions, the contract owner will set the payout mapping
* stored in the `payouts` variable. This maps each grant receiving address to the match amount
* owed, in DAI
* 4. Once this mapping has been set for each grant, the contract owner calls `finalize()`. This
* sets `finalized` to `true`, and at this point the payout mapping can no longer be updated.
* 5. Funders review the payout mapping, and if they approve they transfer their funds to this
* contract. This can be done with an ordinary transfer to this contract address.
* 6. Once all funds have been transferred, the contract owner calls `enablePayouts` which lets
* grant owners withdraw their match payments
* 6. Grant owners can now call `withdraw()` to have their match payout sent to their address.
* Anyone can call this method on behalf of a grant owner, which is useful if your Gitcoin
* grants address cannot call contract methods.
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* WARNING: DO NOT SEND ANYTHING EXCEPT FOR DAI TO THIS CONTRACT OR IT WILL BE LOST! *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
contract MatchPayouts {
using SafeERC20 for IERC20;
// ======================================= STATE VARIABLES =======================================
/// @dev Address that can modify contract state
address public immutable owner;
/// @dev Address where funding comes from (Gitcoin Grants multisig)
address public immutable funder;
/// @dev Token used for match payouts
IERC20 public immutable dai;
/// @dev Convenience type used for setting inputs
struct PayoutFields {
address recipient; // grant receiving address
uint256 amount; // match amount for that grant
}
/// @dev Maps a grant's receiving address their match amount
mapping(address => uint256) public payouts;
/// @dev `Waiting` for payment mapping to be set, then mapping is `Finalized`, and lastly the
/// contract is `Funded`
enum State {Waiting, Finalized, Funded}
State public state = State.Waiting;
// =========================================== EVENTS ============================================
/// @dev Emitted when state is set to `Finalized`
event Finalized();
/// @dev Emitted when state is set to `Funded`
event Funded();
/// @dev Emitted when the funder reclaims the funds in this contract
event FundingWithdrawn(IERC20 indexed token, uint256 amount);
/// @dev Emitted when a payout `amount` is added to the `recipient`'s payout total
event PayoutAdded(address recipient, uint256 amount);
/// @dev Emitted when a `recipient` withdraws their payout
event PayoutClaimed(address indexed recipient, uint256 amount);
// ================================== CONSTRUCTOR AND MODIFIERS ==================================
/**
* @param _owner Address of contract owner
* @param _funder Address of funder
* @param _dai DAI address
*/
constructor(
address _owner,
address _funder,
IERC20 _dai
) {
owner = _owner;
funder = _funder;
dai = _dai;
}
/// @dev Requires caller to be the owner
modifier onlyOwner() {
require(msg.sender == owner, "MatchPayouts: caller is not the owner");
_;
}
/// @dev Prevents method from being called unless contract is in the specified state
modifier requireState(State _state) {
require(state == _state, "MatchPayouts: Not in required state");
_;
}
// ======================================= PRIMARY METHODS =======================================
// Functions are laid out in the order they will be called over the lifetime of the contract
/**
* @notice Set's the mapping of addresses to their match amount
* @dev This will need to be called multiple times to prevent exceeding the block gas limit, based
* on the number of grants
* @param _payouts Array of `Payout`s to set
*/
function setPayouts(PayoutFields[] calldata _payouts) external onlyOwner requireState(State.Waiting) {
// Set each payout amount. We allow amount to be overriden in subsequent calls because this lets
// us fix mistakes before finalizing the payout mapping
for (uint256 i = 0; i < _payouts.length; i += 1) {
payouts[_payouts[i].recipient] = _payouts[i].amount;
emit PayoutAdded(_payouts[i].recipient, _payouts[i].amount);
}
}
/**
* @notice Called by the owner to signal that the payout mapping is finalized
* @dev Once called, this cannot be reversed!
* @dev We use an explicit method here instead of doing this as part of the `setPayouts()` method
* to reduce the chance of accidentally setting this flag
*/
function finalize() external onlyOwner requireState(State.Waiting) {
state = State.Finalized;
emit Finalized();
}
/**
* @notice Enables funder to withdraw all funds
* @dev Escape hatch, intended to be used if the payout mapping is finalized incorrectly. In this
* case a new MatchPayouts contract can be deployed and that one will be used instead
* @dev We trust the funder, which is why they are allowed to withdraw funds at any time
* @param _token Address of token to withdraw from this contract
*/
function withdrawFunding(IERC20 _token) external {
require(msg.sender == funder, "MatchPayouts: caller is not the funder");
uint256 _balance = _token.balanceOf(address(this));
_token.safeTransfer(funder, _balance);
emit FundingWithdrawn(_token, _balance);
}
/**
* @notice Called by the owner to enable withdrawals of match payouts
* @dev Once called, this cannot be reversed!
*/
function enablePayouts() external onlyOwner requireState(State.Finalized) {
state = State.Funded;
emit Funded();
}
/**
* @notice Withdraws funds owed to `_recipient`
* @param _recipient Address to withdraw for
*/
function claimMatchPayout(address _recipient) external requireState(State.Funded) {
uint256 _amount = payouts[_recipient]; // save off amount owed
payouts[_recipient] = 0; // clear storage to mitigate reentrancy (not likely anyway since we trust Dai)
dai.safeTransfer(_recipient, _amount);
emit PayoutClaimed(_recipient, _amount);
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 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 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), 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 data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);
/**
* @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);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_funder","type":"address"},{"internalType":"contract IERC20","name":"_dai","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[],"name":"Finalized","type":"event"},{"anonymous":false,"inputs":[],"name":"Funded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FundingWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PayoutAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PayoutClaimed","type":"event"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"}],"name":"claimMatchPayout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dai","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enablePayouts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"finalize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"funder","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"payouts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct MatchPayouts.PayoutFields[]","name":"_payouts","type":"tuple[]"}],"name":"setPayouts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"state","outputs":[{"internalType":"enum MatchPayouts.State","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"withdrawFunding","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60e06040526001805460ff1916905534801561001a57600080fd5b50604051610d37380380610d3783398101604081905261003991610060565b6001600160601b0319606093841b811660805291831b821660a05290911b1660c0526100c4565b600080600060608486031215610074578283fd5b835161007f816100ac565b6020850151909350610090816100ac565b60408501519092506100a1816100ac565b809150509250925092565b6001600160a01b03811681146100c157600080fd5b50565b60805160601c60a05160601c60c05160601c610c20610117600039806103d9528061067d525080610153528061018052806102565250806102cb5280610448528061047552806105305250610c206000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b14610111578063b038d93414610119578063c19d93fb14610121578063c1bebdf514610136578063f4b9fa75146101495761009e565b8063041ae880146100a3578063314d35c3146100c15780634bb278f3146100d657806365bcfbe7146100de5780638658b340146100fe575b600080fd5b6100ab610151565b6040516100b89190610a6a565b60405180910390f35b6100d46100cf3660046109c6565b610175565b005b6100d46102c0565b6100f16100ec3660046109c6565b610371565b6040516100b89190610b79565b6100d461010c3660046109c6565b610383565b6100ab610446565b6100d461046a565b61012961051c565b6040516100b89190610a97565b6100d46101443660046109e2565b610525565b6100ab61067b565b7f000000000000000000000000000000000000000000000000000000000000000081565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101c65760405162461bcd60e51b81526004016101bd90610aab565b60405180910390fd5b6040516370a0823160e01b81526000906001600160a01b038316906370a08231906101f5903090600401610a6a565b60206040518083038186803b15801561020d57600080fd5b505afa158015610221573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102459190610a52565b905061027b6001600160a01b0383167f00000000000000000000000000000000000000000000000000000000000000008361069f565b816001600160a01b03167f4cd5d77630469c8bf31f4f713e8d3486394a520a59fb307e64509ff320086835826040516102b49190610b79565b60405180910390a25050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103085760405162461bcd60e51b81526004016101bd90610af1565b60008060015460ff16600281111561031c57fe5b146103395760405162461bcd60e51b81526004016101bd90610b36565b6001805460ff1916811790556040517f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768190600090a150565b60006020819052908152604090205481565b60028060015460ff16600281111561039757fe5b146103b45760405162461bcd60e51b81526004016101bd90610b36565b6001600160a01b038083166000908152602081905260408120805491905590610400907f000000000000000000000000000000000000000000000000000000000000000016848361069f565b826001600160a01b03167fec68461f5d4cc45c89e914cb8826a966c73dd35e5f97815ece0a01ffa4a025a6826040516104399190610b79565b60405180910390a2505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104b25760405162461bcd60e51b81526004016101bd90610af1565b60018060015460ff1660028111156104c657fe5b146104e35760405162461bcd60e51b81526004016101bd90610b36565b6001805460ff191660021790556040517f302777af5d26fab9dd5120c5f1307c65193ebc51daf33244ada4365fab10602c90600090a150565b60015460ff1681565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461056d5760405162461bcd60e51b81526004016101bd90610af1565b60008060015460ff16600281111561058157fe5b1461059e5760405162461bcd60e51b81526004016101bd90610b36565b60005b82811015610675578383828181106105b557fe5b905060400201602001356000808686858181106105ce57fe5b6105e492602060409092020190810191506109c6565b6001600160a01b031681526020810191909152604001600020557f55dbe92aa12ba19144cfcbafdabdae28d2aab73d08354910d9edc2882aad769a84848381811061062b57fe5b61064192602060409092020190810191506109c6565b85858481811061064d57fe5b90506040020160200135604051610665929190610a7e565b60405180910390a16001016105a1565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526106f19084906106f6565b505050565b606061074b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166107a79092919063ffffffff16565b8051909150156106f15780806020019051602081101561076a57600080fd5b50516106f15760405162461bcd60e51b815260040180806020018281038252602a815260200180610bc1602a913960400191505060405180910390fd5b60606107b684846000856107c0565b90505b9392505050565b6060824710156108015760405162461bcd60e51b8152600401808060200182810382526026815260200180610b9b6026913960400191505060405180910390fd5b61080a8561091c565b61085b576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831061089a5780518252601f19909201916020918201910161087b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146108fc576040519150601f19603f3d011682016040523d82523d6000602084013e610901565b606091505b5091509150610911828286610922565b979650505050505050565b3b151590565b606083156109315750816107b9565b8251156109415782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561098b578181015183820152602001610973565b50505050905090810190601f1680156109b85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000602082840312156109d7578081fd5b81356107b981610b82565b600080602083850312156109f4578081fd5b823567ffffffffffffffff80821115610a0b578283fd5b818501915085601f830112610a1e578283fd5b813581811115610a2c578384fd5b866020604083028501011115610a40578384fd5b60209290920196919550909350505050565b600060208284031215610a63578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020810160038310610aa557fe5b91905290565b60208082526026908201527f4d617463685061796f7574733a2063616c6c6572206973206e6f742074686520604082015265333ab73232b960d11b606082015260800190565b60208082526025908201527f4d617463685061796f7574733a2063616c6c6572206973206e6f74207468652060408201526437bbb732b960d91b606082015260800190565b60208082526023908201527f4d617463685061796f7574733a204e6f7420696e20726571756972656420737460408201526261746560e81b606082015260800190565b90815260200190565b6001600160a01b0381168114610b9757600080fd5b5056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220ebf8d858a8ce3f0475f7ee341faf6ddc192f2801fee71724e17efd2a48f3e33064736f6c634300070500330000000000000000000000005cdb35fadb8262a3f88863254c870c2e6a848cca000000000000000000000000de21f729137c5af1b01d73af1dc21effa2b8a0d60000000000000000000000006b175474e89094c44da98b954eedeac495271d0f
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b14610111578063b038d93414610119578063c19d93fb14610121578063c1bebdf514610136578063f4b9fa75146101495761009e565b8063041ae880146100a3578063314d35c3146100c15780634bb278f3146100d657806365bcfbe7146100de5780638658b340146100fe575b600080fd5b6100ab610151565b6040516100b89190610a6a565b60405180910390f35b6100d46100cf3660046109c6565b610175565b005b6100d46102c0565b6100f16100ec3660046109c6565b610371565b6040516100b89190610b79565b6100d461010c3660046109c6565b610383565b6100ab610446565b6100d461046a565b61012961051c565b6040516100b89190610a97565b6100d46101443660046109e2565b610525565b6100ab61067b565b7f000000000000000000000000de21f729137c5af1b01d73af1dc21effa2b8a0d681565b336001600160a01b037f000000000000000000000000de21f729137c5af1b01d73af1dc21effa2b8a0d616146101c65760405162461bcd60e51b81526004016101bd90610aab565b60405180910390fd5b6040516370a0823160e01b81526000906001600160a01b038316906370a08231906101f5903090600401610a6a565b60206040518083038186803b15801561020d57600080fd5b505afa158015610221573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102459190610a52565b905061027b6001600160a01b0383167f000000000000000000000000de21f729137c5af1b01d73af1dc21effa2b8a0d68361069f565b816001600160a01b03167f4cd5d77630469c8bf31f4f713e8d3486394a520a59fb307e64509ff320086835826040516102b49190610b79565b60405180910390a25050565b336001600160a01b037f0000000000000000000000005cdb35fadb8262a3f88863254c870c2e6a848cca16146103085760405162461bcd60e51b81526004016101bd90610af1565b60008060015460ff16600281111561031c57fe5b146103395760405162461bcd60e51b81526004016101bd90610b36565b6001805460ff1916811790556040517f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768190600090a150565b60006020819052908152604090205481565b60028060015460ff16600281111561039757fe5b146103b45760405162461bcd60e51b81526004016101bd90610b36565b6001600160a01b038083166000908152602081905260408120805491905590610400907f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f16848361069f565b826001600160a01b03167fec68461f5d4cc45c89e914cb8826a966c73dd35e5f97815ece0a01ffa4a025a6826040516104399190610b79565b60405180910390a2505050565b7f0000000000000000000000005cdb35fadb8262a3f88863254c870c2e6a848cca81565b336001600160a01b037f0000000000000000000000005cdb35fadb8262a3f88863254c870c2e6a848cca16146104b25760405162461bcd60e51b81526004016101bd90610af1565b60018060015460ff1660028111156104c657fe5b146104e35760405162461bcd60e51b81526004016101bd90610b36565b6001805460ff191660021790556040517f302777af5d26fab9dd5120c5f1307c65193ebc51daf33244ada4365fab10602c90600090a150565b60015460ff1681565b336001600160a01b037f0000000000000000000000005cdb35fadb8262a3f88863254c870c2e6a848cca161461056d5760405162461bcd60e51b81526004016101bd90610af1565b60008060015460ff16600281111561058157fe5b1461059e5760405162461bcd60e51b81526004016101bd90610b36565b60005b82811015610675578383828181106105b557fe5b905060400201602001356000808686858181106105ce57fe5b6105e492602060409092020190810191506109c6565b6001600160a01b031681526020810191909152604001600020557f55dbe92aa12ba19144cfcbafdabdae28d2aab73d08354910d9edc2882aad769a84848381811061062b57fe5b61064192602060409092020190810191506109c6565b85858481811061064d57fe5b90506040020160200135604051610665929190610a7e565b60405180910390a16001016105a1565b50505050565b7f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f81565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526106f19084906106f6565b505050565b606061074b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166107a79092919063ffffffff16565b8051909150156106f15780806020019051602081101561076a57600080fd5b50516106f15760405162461bcd60e51b815260040180806020018281038252602a815260200180610bc1602a913960400191505060405180910390fd5b60606107b684846000856107c0565b90505b9392505050565b6060824710156108015760405162461bcd60e51b8152600401808060200182810382526026815260200180610b9b6026913960400191505060405180910390fd5b61080a8561091c565b61085b576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831061089a5780518252601f19909201916020918201910161087b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146108fc576040519150601f19603f3d011682016040523d82523d6000602084013e610901565b606091505b5091509150610911828286610922565b979650505050505050565b3b151590565b606083156109315750816107b9565b8251156109415782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561098b578181015183820152602001610973565b50505050905090810190601f1680156109b85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000602082840312156109d7578081fd5b81356107b981610b82565b600080602083850312156109f4578081fd5b823567ffffffffffffffff80821115610a0b578283fd5b818501915085601f830112610a1e578283fd5b813581811115610a2c578384fd5b866020604083028501011115610a40578384fd5b60209290920196919550909350505050565b600060208284031215610a63578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020810160038310610aa557fe5b91905290565b60208082526026908201527f4d617463685061796f7574733a2063616c6c6572206973206e6f742074686520604082015265333ab73232b960d11b606082015260800190565b60208082526025908201527f4d617463685061796f7574733a2063616c6c6572206973206e6f74207468652060408201526437bbb732b960d91b606082015260800190565b60208082526023908201527f4d617463685061796f7574733a204e6f7420696e20726571756972656420737460408201526261746560e81b606082015260800190565b90815260200190565b6001600160a01b0381168114610b9757600080fd5b5056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220ebf8d858a8ce3f0475f7ee341faf6ddc192f2801fee71724e17efd2a48f3e33064736f6c63430007050033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005cdb35fadb8262a3f88863254c870c2e6a848cca000000000000000000000000de21f729137c5af1b01d73af1dc21effa2b8a0d60000000000000000000000006b175474e89094c44da98b954eedeac495271d0f
-----Decoded View---------------
Arg [0] : _owner (address): 0x5cdb35fADB8262A3f88863254c870c2e6A848CcA
Arg [1] : _funder (address): 0xde21F729137C5Af1b01d73aF1dC21eFfa2B8a0d6
Arg [2] : _dai (address): 0x6B175474E89094C44Da98b954EedeAC495271d0F
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000005cdb35fadb8262a3f88863254c870c2e6a848cca
Arg [1] : 000000000000000000000000de21f729137c5af1b01d73af1dc21effa2b8a0d6
Arg [2] : 0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.