Skip to content

Commit

Permalink
Merge branch 'solmate-updates' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
hmrtn authored Jan 5, 2022
2 parents 912a0a1 + 08b3d40 commit 646c9a3
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/hardhat/contracts/Distributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ contract Distributor {
}

if (msg.value > total) {
(bool sent, ) = msg.sender.call{value: msg.value - total}("");
require(sent, "FAILED_CONTRACT_DRAIN");
SafeTransferLib.safeTransferETH(msg.sender, msg.value - total);
}

emit ethDistributed(msg.sender, id);
Expand Down
114 changes: 111 additions & 3 deletions packages/react-app/src/contracts/hardhat_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"chainId": "1",
"contracts": {
"Distributor": {
"address": "0x3E1516166E38eF3C995BDad7a27e8B1643e3450D",
"address": "0x14313eB3823D0268C49d2D977b6Fb1eE2233Ef20",
"abi": [
{
"anonymous": false,
Expand Down Expand Up @@ -113,7 +113,7 @@
"chainId": "4",
"contracts": {
"Distributor": {
"address": "0x0e76C65F57D88DD35079E19CEa92a3bA197C18D4",
"address": "0xEa99C58645f897ac8BF530538e36e6D651ff8bF7",
"abi": [
{
"anonymous": false,
Expand Down Expand Up @@ -221,7 +221,115 @@
"chainId": "5",
"contracts": {
"Distributor": {
"address": "0x80fB8Dc425f13b9118d8B382803cAA5289F93218",
"address": "0xC7fE6Af7dAa0e3f98d56ebbABdE0b97EfA5Ed42f",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": true,
"internalType": "string",
"name": "id",
"type": "string"
}
],
"name": "ethDistributed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": true,
"internalType": "string",
"name": "id",
"type": "string"
}
],
"name": "tokenDistributed",
"type": "event"
},
{
"inputs": [
{
"internalType": "address[]",
"name": "recipients",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "values",
"type": "uint256[]"
},
{
"internalType": "string",
"name": "id",
"type": "string"
}
],
"name": "distributeEther",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract ERC20",
"name": "token",
"type": "address"
},
{
"internalType": "address[]",
"name": "recipients",
"type": "address[]"
},
{
"internalType": "uint256[]",
"name": "values",
"type": "uint256[]"
},
{
"internalType": "string",
"name": "id",
"type": "string"
}
],
"name": "distributeToken",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
}
}
},
"137": {
"matic": {
"name": "matic",
"chainId": "137",
"contracts": {
"Distributor": {
"address": "0x9bb1f87f3e80bee26bcb491489c1b41e0e15b16d",
"abi": [
{
"anonymous": false,
Expand Down

0 comments on commit 646c9a3

Please sign in to comment.