Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add payment contract functions - deploy and show #91

Merged
merged 3 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
304 changes: 304 additions & 0 deletions contracts/v4/Payment.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,304 @@
[
{
"inputs": [
{
"internalType": "address[]",
"name": "payees",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "shares_",
"type": "uint256[]"
}
],
"stateMutability": "payable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "contract IERC20",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "ERC20PaymentReleased",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "shares",
"type": "uint256"
}
],
"name": "PayeeAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "PaymentReceived",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "PaymentReleased",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "payee",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "releasable",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "releasable",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address payable",
"name": "account",
"type": "address"
}
],
"name": "release",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "release",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20",
"name": "token",
"type": "address"
},
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "released",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "released",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "shares",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20",
"name": "token",
"type": "address"
}
],
"name": "totalReleased",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalReleased",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalShares",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]
1 change: 1 addition & 0 deletions contracts/v4/Payment.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0x6080604052604051620011d4380380620011d4833981016040819052620000269162000432565b818180518251146200009a5760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b60648201526084015b60405180910390fd5b6000825111620000ed5760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f20706179656573000000000000604482015260640162000091565b60005b825181101562000159576200014483828151811062000113576200011362000510565b602002602001015183838151811062000130576200013062000510565b60200260200101516200016460201b60201c565b8062000150816200053c565b915050620000f0565b505050505062000573565b6001600160a01b038216620001d15760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b606482015260840162000091565b60008111620002235760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a20736861726573206172652030000000604482015260640162000091565b6001600160a01b038216600090815260026020526040902054156200029f5760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b606482015260840162000091565b60048054600181019091557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0319166001600160a01b0384169081179091556000908152600260205260408120829055546200030790829062000558565b600055604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562000391576200039162000350565b604052919050565b60006001600160401b03821115620003b557620003b562000350565b5060051b60200190565b600082601f830112620003d157600080fd5b81516020620003ea620003e48362000399565b62000366565b82815260059290921b840181019181810190868411156200040a57600080fd5b8286015b848110156200042757805183529183019183016200040e565b509695505050505050565b600080604083850312156200044657600080fd5b82516001600160401b03808211156200045e57600080fd5b818501915085601f8301126200047357600080fd5b8151602062000486620003e48362000399565b82815260059290921b84018101918181019089841115620004a657600080fd5b948201945b83861015620004dd5785516001600160a01b0381168114620004cd5760008081fd5b82529482019490820190620004ab565b91880151919650909350505080821115620004f757600080fd5b506200050685828601620003bf565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820162000551576200055162000526565b5060010190565b600082198211156200056e576200056e62000526565b500190565b610c5180620005836000396000f3fe6080604052600436106100a05760003560e01c80639852595c116100645780639852595c146101d2578063a3f8eace14610208578063c45ac05014610228578063ce7c2ac214610248578063d79779b21461027e578063e33b7de3146102b457600080fd5b806319165587146100ee5780633a98ef3914610110578063406072a91461013457806348b750441461017a5780638b83209b1461019a57600080fd5b366100e9577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b3480156100fa57600080fd5b5061010e6101093660046109c5565b6102c9565b005b34801561011c57600080fd5b506000545b6040519081526020015b60405180910390f35b34801561014057600080fd5b5061012161014f3660046109e2565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b34801561018657600080fd5b5061010e6101953660046109e2565b6103b9565b3480156101a657600080fd5b506101ba6101b5366004610a1b565b6104ca565b6040516001600160a01b03909116815260200161012b565b3480156101de57600080fd5b506101216101ed3660046109c5565b6001600160a01b031660009081526003602052604090205490565b34801561021457600080fd5b506101216102233660046109c5565b6104fa565b34801561023457600080fd5b506101216102433660046109e2565b610542565b34801561025457600080fd5b506101216102633660046109c5565b6001600160a01b031660009081526002602052604090205490565b34801561028a57600080fd5b506101216102993660046109c5565b6001600160a01b031660009081526005602052604090205490565b3480156102c057600080fd5b50600154610121565b6001600160a01b0381166000908152600260205260409020546103075760405162461bcd60e51b81526004016102fe90610a34565b60405180910390fd5b6000610312826104fa565b9050806000036103345760405162461bcd60e51b81526004016102fe90610a7a565b80600160008282546103469190610adb565b90915550506001600160a01b0382166000908152600360205260409020805482019055610373828261060d565b604080516001600160a01b0384168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a15050565b6001600160a01b0381166000908152600260205260409020546103ee5760405162461bcd60e51b81526004016102fe90610a34565b60006103fa8383610542565b90508060000361041c5760405162461bcd60e51b81526004016102fe90610a7a565b6001600160a01b03831660009081526005602052604081208054839290610444908490610adb565b90915550506001600160a01b03808416600090815260066020908152604080832093861683529290522080548201905561047f83838361072b565b604080516001600160a01b038481168252602082018490528516917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a2505050565b6000600482815481106104df576104df610af3565b6000918252602090912001546001600160a01b031692915050565b60008061050660015490565b6105109047610adb565b905061053b8382610536866001600160a01b031660009081526003602052604090205490565b61077d565b9392505050565b6001600160a01b03821660009081526005602052604081205481906040516370a0823160e01b81523060048201526001600160a01b038616906370a0823190602401602060405180830381865afa1580156105a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c59190610b09565b6105cf9190610adb565b6001600160a01b03808616600090815260066020908152604080832093881683529290522054909150610605908490839061077d565b949350505050565b8047101561065d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016102fe565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146106aa576040519150601f19603f3d011682016040523d82523d6000602084013e6106af565b606091505b50509050806107265760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016102fe565b505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526107269084906107b8565b600080546001600160a01b0385168252600260205260408220548391906107a49086610b22565b6107ae9190610b41565b6106059190610b63565b600061080d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661088a9092919063ffffffff16565b805190915015610726578080602001905181019061082b9190610b7a565b6107265760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102fe565b6060610605848460008585600080866001600160a01b031685876040516108b19190610bcc565b60006040518083038185875af1925050503d80600081146108ee576040519150601f19603f3d011682016040523d82523d6000602084013e6108f3565b606091505b50915091506109048783838761090f565b979650505050505050565b6060831561097e578251600003610977576001600160a01b0385163b6109775760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102fe565b5081610605565b61060583838151156109935781518083602001fd5b8060405162461bcd60e51b81526004016102fe9190610be8565b6001600160a01b03811681146109c257600080fd5b50565b6000602082840312156109d757600080fd5b813561053b816109ad565b600080604083850312156109f557600080fd5b8235610a00816109ad565b91506020830135610a10816109ad565b809150509250929050565b600060208284031215610a2d57600080fd5b5035919050565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115610aee57610aee610ac5565b500190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610b1b57600080fd5b5051919050565b6000816000190483118215151615610b3c57610b3c610ac5565b500290565b600082610b5e57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015610b7557610b75610ac5565b500390565b600060208284031215610b8c57600080fd5b8151801515811461053b57600080fd5b60005b83811015610bb7578181015183820152602001610b9f565b83811115610bc6576000848401525b50505050565b60008251610bde818460208701610b9c565b9190910192915050565b6020815260008251806020840152610c07816040850160208701610b9c565b601f01601f1916919091016040019291505056fea26469706673582212202447f711e8cf7cfd98182388578d1e6d1207799a7521c8a3f816019d18ea16e664736f6c634300080d0033
Loading