Created
December 11, 2018 17:56
-
-
Save mikhaildobs/26d2ffdbb9dd61beb88470bb00308fb5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract IGivethBridge { | |
function donateAndCreateGiver(address giver, uint64 receiverId, address token, uint _amount) payable public { | |
} | |
} | |
contract Donator { | |
IGivethBridge givethBridge = IGivethBridge(0xC59dCE5CCC065A4b51A2321F857466A25ca49B40); | |
uint64 public givethReceiverId = 226; | |
function donateWeird() public payable returns (bool success) { | |
address giver = msg.sender; | |
bytes memory _data = getBytesData(giver, givethReceiverId); | |
success = givethBridge.call.value(msg.value)(_data); | |
} | |
function getBytesData(address giver, uint receiverId) public view returns (bytes data) { | |
data = abi.encodePacked( | |
0x1870c10f, | |
bytes32(giver), | |
bytes32(receiverId), | |
bytes32(0), | |
bytes32(0) | |
); | |
return data; | |
} | |
function donate() public payable returns (bool success) { | |
address giver = msg.sender; | |
givethBridge.donateAndCreateGiver.value(msg.value)(giver, givethReceiverId, 0, 0); | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment