-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1591 from oasisprotocol/mitjat/transfer-event-always
runtime-sdk/evm: Emit Transfer event for contract-initiated transfers
- Loading branch information
Showing
6 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
contract = faucet.sol | ||
abi = faucet.abi | ||
hex = faucet.hex | ||
|
||
include ../contracts.mk | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"inputs":[{"internalType":"uint256","name":"withdraw_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
608060405234801561000f575f80fd5b5060d08061001c5f395ff3fe608060405260043610601e575f3560e01c80632e1a7d4d146028575f80fd5b36602457005b5f80fd5b3480156032575f80fd5b506042603e3660046084565b6044565b005b67016345785d8a00008111156057575f80fd5b604051339082156108fc029083905f818181858888f193505050501580156080573d5f803e3d5ffd5b5050565b5f602082840312156093575f80fd5b503591905056fea264697066735822122064dc104c8e0f2cbd31a4d9e6238c2c1e2867b04ca485d3836b2810e582a7079d64736f6c63430008170033 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
pragma solidity ^0.8.0; | ||
|
||
// Minimal faucet contract. | ||
contract Faucet { | ||
// Accept any incoming amount. | ||
receive() external payable {} | ||
|
||
// Give out native tokens to anyone who asks. | ||
function withdraw(uint256 withdraw_amount) public { | ||
// Limit withdrawal amount. | ||
require(withdraw_amount <= 100000000000000000); | ||
|
||
// Send the amount to the address that requested it. | ||
payable(msg.sender).transfer(withdraw_amount); | ||
} | ||
} |