xDAI Price: $1.00 (+0.02%)
Gas: 1.1 GWei

Contract

0xA840bE89F36a0AcE0e86e7d016382F9e50206102
Transaction Hash
Method
Block
From
To
Transfer204149752022-02-01 15:48:251176 days ago1643730505IN
0xA840bE89...e50206102
55.5 xDAI0.000950953.60000001
Transfer204145582022-02-01 15:13:401176 days ago1643728420IN
0xA840bE89...e50206102
83.25 xDAI0.001743426.6
Transfer204106072022-02-01 9:44:051177 days ago1643708645IN
0xA840bE89...e50206102
666 xDAI0.000673592.55
Transfer204083542022-02-01 6:36:201177 days ago1643697380IN
0xA840bE89...e50206102
582.75 xDAI0.000174691.1
Transfer204071422022-02-01 4:55:201177 days ago1643691320IN
0xA840bE89...e50206102
555 xDAI0.000161991.02
Transfer204044922022-02-01 1:14:301177 days ago1643678070IN
0xA840bE89...e50206102
499.5 xDAI0.000397042.5
Transfer204040922022-02-01 0:41:101177 days ago1643676070IN
0xA840bE89...e50206102
666 xDAI0.000660382.5
Transfer204025842022-01-31 22:35:301177 days ago1643668530IN
0xA840bE89...e50206102
666 xDAI0.000660382.5
Transfer204021382022-01-31 21:58:201177 days ago1643666300IN
0xA840bE89...e50206102
333 xDAI0.001320775
Transfer204020802022-01-31 21:53:301177 days ago1643666010IN
0xA840bE89...e50206102
27.75 xDAI0.001320775
Transfer203986532022-01-31 17:07:401177 days ago1643648860IN
0xA840bE89...e50206102
83.25 xDAI0.000792463.00000001
Transfer203976832022-01-31 15:46:401177 days ago1643644000IN
0xA840bE89...e50206102
111 xDAI0.000660382.50000156
Transfer203906962022-01-31 6:03:351178 days ago1643609015IN
0xA840bE89...e50206102
666 xDAI0.000633972.4
Transfer203897532022-01-31 4:45:001178 days ago1643604300IN
0xA840bE89...e50206102
83.5032654 xDAI0.000398221.4688
Transfer203849972022-01-30 22:08:301178 days ago1643580510IN
0xA840bE89...e50206102
55.5 xDAI0.0043585516.5
Transfer203824932022-01-30 18:39:501178 days ago1643567990IN
0xA840bE89...e50206102
27.75 xDAI0.011768144.55
Transfer203673472022-01-29 21:36:551179 days ago1643492215IN
0xA840bE89...e50206102
82.5 xDAI0.0054225220
Transfer203647352022-01-29 17:59:001179 days ago1643479140IN
0xA840bE89...e50206102
35 xDAI0.000677812.5
Transfer203628012022-01-29 15:17:501179 days ago1643469470IN
0xA840bE89...e50206102
55.5 xDAI0.0066038725
Transfer203478022022-01-28 18:27:151180 days ago1643394435IN
0xA840bE89...e50206102
666 xDAI0.000792723.001
Transfer203357892022-01-28 1:43:451181 days ago1643334225IN
0xA840bE89...e50206102
55.5 xDAI0.015849360
Transfer203356922022-01-28 1:35:401181 days ago1643333740IN
0xA840bE89...e50206102
55.5 xDAI0.000673592.55
Transfer203340842022-01-27 23:21:401181 days ago1643325700IN
0xA840bE89...e50206102
40.4 xDAI0.000813643.001
Transfer203336482022-01-27 22:45:101181 days ago1643323510IN
0xA840bE89...e50206102
27.75 xDAI0.00047663.001
Transfer203335342022-01-27 22:35:351181 days ago1643322935IN
0xA840bE89...e50206102
666 xDAI0.013471951
VIEW ADVANCED FILTER

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
204149752022-02-01 15:48:251176 days ago1643730505
0xA840bE89...e50206102
55.5 xDAI
204145582022-02-01 15:13:401176 days ago1643728420
0xA840bE89...e50206102
83.25 xDAI
204106072022-02-01 9:44:051177 days ago1643708645
0xA840bE89...e50206102
666 xDAI
204083542022-02-01 6:36:201177 days ago1643697380
0xA840bE89...e50206102
582.75 xDAI
204071422022-02-01 4:55:201177 days ago1643691320
0xA840bE89...e50206102
555 xDAI
204044922022-02-01 1:14:301177 days ago1643678070
0xA840bE89...e50206102
499.5 xDAI
204040922022-02-01 0:41:101177 days ago1643676070
0xA840bE89...e50206102
666 xDAI
204025842022-01-31 22:35:301177 days ago1643668530
0xA840bE89...e50206102
666 xDAI
204021382022-01-31 21:58:201177 days ago1643666300
0xA840bE89...e50206102
333 xDAI
204020802022-01-31 21:53:301177 days ago1643666010
0xA840bE89...e50206102
27.75 xDAI
203986532022-01-31 17:07:401177 days ago1643648860
0xA840bE89...e50206102
83.25 xDAI
203976832022-01-31 15:46:401177 days ago1643644000
0xA840bE89...e50206102
111 xDAI
203906962022-01-31 6:03:351178 days ago1643609015
0xA840bE89...e50206102
666 xDAI
203897532022-01-31 4:45:001178 days ago1643604300
0xA840bE89...e50206102
0.2532654 xDAI
203897532022-01-31 4:45:001178 days ago1643604300
0xA840bE89...e50206102
83.25 xDAI
203849972022-01-30 22:08:301178 days ago1643580510
0xA840bE89...e50206102
55.5 xDAI
203824932022-01-30 18:39:501178 days ago1643567990
0xA840bE89...e50206102
27.75 xDAI
203673472022-01-29 21:36:551179 days ago1643492215
0xA840bE89...e50206102
27 xDAI
203673472022-01-29 21:36:551179 days ago1643492215
0xA840bE89...e50206102
55.5 xDAI
203647352022-01-29 17:59:001179 days ago1643479140
0xA840bE89...e50206102
7.25 xDAI
203647352022-01-29 17:59:001179 days ago1643479140
0xA840bE89...e50206102
27.75 xDAI
203628012022-01-29 15:17:501179 days ago1643469470
0xA840bE89...e50206102
55.5 xDAI
203478022022-01-28 18:27:151180 days ago1643394435
0xA840bE89...e50206102
666 xDAI
203357892022-01-28 1:43:451181 days ago1643334225
0xA840bE89...e50206102
55.5 xDAI
203356922022-01-28 1:35:401181 days ago1643333740
0xA840bE89...e50206102
55.5 xDAI
View All Internal Transactions
Loading...
Loading

Minimal Proxy Contract for 0xba2fb944043d87efe8b188e6c024987a14ba648b

Contract Name:
Yeeter

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at gnosisscan.io on 2022-08-05
*/

// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.4;

// import "hardhat/console.sol";
interface IMOLOCH {
    // brief interface for moloch dao v2

    function depositToken() external view returns (address);

    function tokenWhitelist(address token) external view returns (bool);

    function shamans(address token) external view returns (bool);

    function totalShares() external view returns (uint256);

    function getProposalFlags(uint256 proposalId)
        external
        view
        returns (bool[6] memory);

    function getUserTokenBalance(address user, address token)
        external
        view
        returns (uint256);

    function members(address user)
        external
        view
        returns (
            address,
            uint256,
            uint256,
            bool,
            uint256,
            uint256
        );

    function memberAddressByDelegateKey(address user)
        external
        view
        returns (address);

    function userTokenBalances(address user, address token)
        external
        view
        returns (uint256);

    function cancelProposal(uint256 proposalId) external;

    function submitProposal(
        address applicant,
        uint256 sharesRequested,
        uint256 lootRequested,
        uint256 tributeOffered,
        address tributeToken,
        uint256 paymentRequested,
        address paymentToken,
        string calldata details
    ) external returns (uint256);

    function withdrawBalance(address token, uint256 amount) external;

    function collectTokens(address) external;

    struct Proposal {
        address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals (doubles as guild kick target for gkick proposals)
        address proposer; // the account that submitted the proposal (can be non-member)
        address sponsor; // the member that sponsored the proposal (moving it into the queue)
        uint256 sharesRequested; // the # of shares the applicant is requesting
        uint256 lootRequested; // the amount of loot the applicant is requesting
        uint256 tributeOffered; // amount of tokens offered as tribute
        address tributeToken; // tribute token contract reference
        uint256 paymentRequested; // amount of tokens requested as payment
        address paymentToken; // payment token contract reference
        uint256 startingPeriod; // the period in which voting can start for this proposal
        uint256 yesVotes; // the total number of YES votes for this proposal
        uint256 noVotes; // the total number of NO votes for this proposal
        bool[6] flags; // [sponsored, processed, didPass, cancelled, whitelist, guildkick]
        string details; // proposal details - could be IPFS hash, plaintext, or JSON
        uint256 maxTotalSharesAndLootAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
    }

    function proposals(uint256 proposalId)
        external
        view
        returns (
            address,
            address,
            address,
            uint256,
            uint256,
            uint256,
            address,
            uint256,
            address,
            uint256,
            uint256,
            uint256
        );

    function setSharesLoot(
        address[] calldata,
        uint256[] calldata,
        uint256[] calldata,
        bool mint
    ) external;

    function setSingleSharesLoot(
        address,
        uint256,
        uint256,
        bool
    ) external;

    function setShaman(address, bool) external;
}

interface IWRAPPER {
    function transfer(address recipient, uint256 amount)
        external
        returns (bool);
}

abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(
            newOwner != address(0),
            "Ownable: new owner is the zero address"
        );
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

contract Yeeter is ReentrancyGuard {
    event YeetReceived(
        address indexed contributorAddress,
        uint256 amount,
        address moloch,
        uint256 lootToGive,
        uint256 lootToPlatform
    );
    mapping(address => uint256) public deposits;
    uint256 public maxTarget;
    uint256 public raiseEndTime;
    uint256 public raiseStartTime;
    uint256 public maxUnitsPerAddr;
    uint256 public pricePerUnit;
    uint256 public lootPerUnit;
    bool public initialized;

    uint256 public platformFee;

    uint256 public balance;
    IMOLOCH public moloch;
    IWRAPPER public wrapper;

    YeetSummoner factory;

    function init(
        address _moloch,
        address payable _wrapper,
        uint256 _maxTarget, // max raise target
        uint256 _raiseEndTime,
        uint256 _raiseStartTime,
        uint256 _maxUnits, // per individual
        uint256 _pricePerUnit
    ) public {
        require(!initialized, "already initialized");
        initialized = true;
        moloch = IMOLOCH(_moloch);
        wrapper = IWRAPPER(_wrapper);
        maxTarget = _maxTarget;
        raiseEndTime = _raiseEndTime;
        raiseStartTime = _raiseStartTime;
        maxUnitsPerAddr = _maxUnits;
        pricePerUnit = _pricePerUnit;

        factory = YeetSummoner(msg.sender);
    }

    function initTemplate() public {
        initialized = true;
    }

    function yeetyeet() public payable nonReentrant {
        require(address(moloch) != address(0), "!init");
        require(msg.value >= pricePerUnit, "< minimum");
        require(balance < maxTarget, "Max Target reached"); // balance plus newvalue
        require(block.timestamp < raiseEndTime, "Time is up");
        require(block.timestamp > raiseStartTime, "Not Started");
        require(moloch.shamans(address(this)), "Shaman not whitelisted");
        require(
            moloch.tokenWhitelist(address(wrapper)),
            "Wrapper not whitelisted"
        );
        uint256 numUnits = msg.value / pricePerUnit; // floor units
        uint256 newValue = numUnits * pricePerUnit;

        // if some one yeets over max should we give them the max and return leftover.
        require(
            deposits[msg.sender] + newValue <= maxUnitsPerAddr * pricePerUnit,
            "Can not deposit more than max"
        );

        // wrap
        (bool success, ) = address(wrapper).call{value: newValue}("");
        require(success, "Wrap failed");
        // send to dao
        require(wrapper.transfer(address(moloch), newValue), "Transfer failed");

        if (msg.value > newValue) {
            // Return the extra money to the minter.
            (bool success2, ) = msg.sender.call{value: msg.value - newValue}(
                ""
            );
            require(success2, "Transfer failed");
        }
        // TODO: check
        deposits[msg.sender] = deposits[msg.sender] + newValue;

        balance = balance + newValue;

        uint256 lootToGive = (numUnits * factory.lootPerUnit());
        uint256 lootToPlatform = (numUnits * factory.platformFee());

        moloch.setSingleSharesLoot(msg.sender, 0, lootToGive, true);
        if (lootToPlatform > 0) {
            moloch.setSingleSharesLoot(
                factory.owner(),
                0,
                lootToPlatform,
                true
            );
        }

        moloch.collectTokens(address(wrapper));

        // amount of loot? fees?
        emit YeetReceived(
            msg.sender,
            newValue,
            address(moloch),
            lootToGive,
            lootToPlatform
        );
    }

    receive() external payable {
        yeetyeet();
    }

    function goalReached() public view returns (bool) {
        return balance >= maxTarget;
    }
}

contract CloneFactory {
    // implementation of eip-1167 - see https://eips.ethereum.org/EIPS/eip-1167
    function createClone(address target) internal returns (address result) {
        bytes20 targetBytes = bytes20(target);
        assembly {
            let clone := mload(0x40)
            mstore(
                clone,
                0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000
            )
            mstore(add(clone, 0x14), targetBytes)
            mstore(
                add(clone, 0x28),
                0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000
            )
            result := create(0, clone, 0x37)
        }
    }
}

contract YeetSummoner is CloneFactory, Ownable {
    address payable public template;
    mapping(uint256 => address) public yeeters;
    uint256 public yeetIdx = 0;

    uint256 public platformFee = 3; // fee of 3.09%
    uint256 public lootPerUnit = 100;

    event PlatformFeeUpdate(uint256 platformFee, uint256 lootPerUnit);

    event SummonYeetComplete(
        address indexed moloch,
        address yeeter,
        address wrapper,
        uint256 maxTarget,
        uint256 raiseEndTime,
        uint256 raiseStartTime,
        uint256 maxUnits,
        uint256 pricePerUnit,
        string details
    );

    constructor(address payable _template) {
        template = _template;
        Yeeter _yeeter = Yeeter(_template);
        _yeeter.initTemplate();
    }

    function summonYeet(
        address _moloch,
        address payable _wrapper,
        uint256 _maxTarget,
        uint256 _raiseEndTime,
        uint256 _raiseStartTime,
        uint256 _maxUnits,
        uint256 _pricePerUnit,
        string calldata _details
    ) public returns (address) {
        Yeeter yeeter = Yeeter(payable(createClone(template)));

        yeeter.init(
            _moloch,
            _wrapper,
            _maxTarget,
            _raiseEndTime,
            _raiseStartTime,
            _maxUnits,
            _pricePerUnit
        );
        yeetIdx = yeetIdx + 1;
        yeeters[yeetIdx] = address(yeeter);

        emit SummonYeetComplete(
            _moloch,
            address(yeeter),
            _wrapper,
            _maxTarget,
            _raiseEndTime,
            _raiseStartTime,
            _maxUnits,
            _pricePerUnit,
            _details
        );

        return address(yeeter);
    }

    // owner only functions
    function setConfig(uint256 _platformFee, uint256 _lootPerUnit)
        public
        onlyOwner
    {
        require(_lootPerUnit > 0, "Can not be 0");
        platformFee = _platformFee;
        lootPerUnit = _lootPerUnit;
        emit PlatformFeeUpdate(platformFee, lootPerUnit);
    }
}

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"contributorAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"moloch","type":"address"},{"indexed":false,"internalType":"uint256","name":"lootToGive","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lootToPlatform","type":"uint256"}],"name":"YeetReceived","type":"event"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"goalReached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_moloch","type":"address"},{"internalType":"address payable","name":"_wrapper","type":"address"},{"internalType":"uint256","name":"_maxTarget","type":"uint256"},{"internalType":"uint256","name":"_raiseEndTime","type":"uint256"},{"internalType":"uint256","name":"_raiseStartTime","type":"uint256"},{"internalType":"uint256","name":"_maxUnits","type":"uint256"},{"internalType":"uint256","name":"_pricePerUnit","type":"uint256"}],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initTemplate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lootPerUnit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTarget","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxUnitsPerAddr","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"moloch","outputs":[{"internalType":"contract IMOLOCH","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pricePerUnit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"raiseEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"raiseStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wrapper","outputs":[{"internalType":"contract IWRAPPER","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"yeetyeet","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

Block Transaction Gas Used Reward
view all blocks validated

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ 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.