From f36878920d4c2d31b912052815749743eef723e6 Mon Sep 17 00:00:00 2001 From: Ville Sundell Date: Mon, 21 May 2018 17:01:26 +0300 Subject: [PATCH] PaymentSplitter: Initial version of the payment splitting contract This is an initial draft of a contract splitting payments between parties. --- contracts/PaymentSplitter.sol | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 contracts/PaymentSplitter.sol diff --git a/contracts/PaymentSplitter.sol b/contracts/PaymentSplitter.sol new file mode 100644 index 00000000..582fe3fe --- /dev/null +++ b/contracts/PaymentSplitter.sol @@ -0,0 +1,40 @@ +/** + * This smart contract code is Copyright 2017 TokenMarket Ltd. For more information see https://tokenmarket.net + * + * Licensed under the Apache License, version 2.0: https://github.com/TokenMarketNet/ico/blob/master/LICENSE.txt + */ + +pragma solidity ^0.4.18; + +/** + * @dev Forward Ethereum payments to two or more parties. + * + * Allows splitting payments between parties. + */ +contract PaymentSplitter { + + struct Part { + address who; + uint shares; + } + + uint totalShares; + Part[] public parts; + + function PaymentSplitter(address[] addresses, uint[] shares) public { + for(uint i=0; i