Skip to content
Verified contractPartial

PaymentAddress

Address0x39535f89e33affedca031d76ada37db08c222ae2
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.4.23

 

Same code

377 more contracts

 

Details

Compiler
solc 0.4.23+commit.124ca40d
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
8,443,033
Creation transaction
0xbf78d24355…ce831b054a
Main copy (most transactions)
0x55fdbab2…1fe2800c

PaymentAddressFactory.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
pragma solidity 0.4.23;


/// @title Version
contract Version {
    string public semanticVersion;

    /// @notice Constructor saves a public version of the deployed Contract.
    /// @param _version Semantic version of the contract.
    constructor(string _version) internal {
        semanticVersion = _version;
    }
}


/// @title Factory
contract Factory is Version {
    event FactoryAddedContract(address indexed _contract);

    modifier contractHasntDeployed(address _contract) {
        require(contracts[_contract] == false);
        _;
    }

    mapping(address => bool) public contracts;

    constructor(string _version) internal Version(_version) {}

    function hasBeenDeployed(address _contract) public constant returns (bool) {
        return contracts[_contract];
    }

    function addContract(address _contract)
        internal
        contractHasntDeployed(_contract)
        returns (bool)
    {
        contracts[_contract] = true;
        emit FactoryAddedContract(_contract);
        return true;
    }
}


contract PaymentAddress {
    event PaymentMade(address indexed _payer, address indexed _collector, uint256 _value);

    address public collector;

    constructor(address _collector) public {
        collector = _collector;
    }

    function () public payable {
        emit PaymentMade(msg.sender, collector, msg.value);
        collector.transfer(msg.value);
    }
}


contract PaymentAddressFactory is Factory {
    // index of created contracts
    mapping (address => address[]) public paymentAddresses;

    constructor() public Factory("1.0.0") {}

    // deploy a new contract
    function newPaymentAddress(address _collector)
        public
        returns(address newContract)
    {
        PaymentAddress paymentAddress = new PaymentAddress(_collector);
        paymentAddresses[_collector].push(paymentAddress);
        addContract(paymentAddress);
        return paymentAddress;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.