Skip to content
Verified contractPartial

WibsonInvestment

Address0xd10e893b4d75f266407c23ffdd1c12482cc84d09
Balance

0 ETH

 

Transactions

13

 

Compiler

solc 0.4.19

 

Same code

Only this contract

 

Details

Compiler
solc 0.4.19+commit.c4cbbb05
Language
solidity
Optimization
Yes, 0 runs
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
5,089,879
Creation transaction
0x45b2b3d2c5…922d5c6735

WibsonInvestment.sol

pragma solidity ^0.4.19;

contract Ownable {
  address public owner;


  /** 
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() internal {
    owner = msg.sender;
  }


  /**
   * @dev Throws if called by any account other than the owner. 
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }


  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to. 
   */
  function transferOwnership(address newOwner) onlyOwner public {
    require(newOwner != address(0));
    owner = newOwner;
  }

}

/**
 * Interface for the standard token.
 * Based on https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
 */
interface EIP20Token {
  function totalSupply() public view returns (uint256);
  function balanceOf(address who) public view returns (uint256);
  function transfer(address to, uint256 value) public returns (bool success);
  function transferFrom(address from, address to, uint256 value) public returns (bool success);
  function approve(address spender, uint256 value) public returns (bool success);
  function allowance(address owner, address spender) public view returns (uint256 remaining);
  event Transfer(address indexed from, address indexed to, uint256 value);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}


// The owner of this contract should be an externally owned account
contract WibsonInvestment is Ownable {

  // Address of the target contract
  address public investment_address = 0xBe25379a36948DfC1a98CdB1Ec7eF155A8D3Fd81;
  // Major partner address
  address public major_partner_address = 0x8f0592bDCeE38774d93bC1fd2c97ee6540385356;
  // Minor partner address
  address public minor_partner_address = 0xC787C3f6F75D7195361b64318CE019f90507f806;
  // Gas used for transfers.
  uint public gas = 1000;

  // Payments to this contract require a bit of gas. 100k should be enough.
  function() payable public {
    execute_transfer(msg.value);
  }

  // Transfer some funds to the target investment address.
  function execute_transfer(uint transfer_amount) internal {
    // Target address receives 10/11 of the amount.
    // We add 1 wei to the quotient to ensure the rounded up value gets sent.
    uint target_amount = (transfer_amount * 10 / 11) + 1;
    // Send the target amount
    require(investment_address.call.gas(gas).value(target_amount)());

    uint leftover = transfer_amount - target_amount;
    // Major fee is 60% * value = (6 / 10) * value
    uint major_fee = leftover * 6 / 10;
    // The minor fee is 40% * value = (4 / 10) * value
    // However, we send it as the rest of the received ether.
    uint minor_fee = leftover - major_fee;

    // Send the major fee
    require(major_partner_address.call.gas(gas).value(major_fee)());
    // Send the minor fee
    require(minor_partner_address.call.gas(gas).value(minor_fee)());
  }

  // Sets the amount of gas allowed to investors
  function set_transfer_gas(uint transfer_gas) public onlyOwner {
    gas = transfer_gas;
  }

  // We can use this function to move unwanted tokens in the contract
  function approve_unwanted_tokens(EIP20Token token, address dest, uint value) public onlyOwner {
    token.approve(dest, value);
  }

  // This contract is designed to have no balance.
  // However, we include this function to avoid stuck value by some unknown mishap.
  function emergency_withdraw() public onlyOwner {
    require(msg.sender.call.gas(gas).value(this.balance)());
  }

}
Compiler settingsShow
{
  "optimizer": {
    "runs": 0,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.