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
/* | |
Warning! The code is not production ready. It is provided for educational purposes only. | |
*/ | |
pragma solidity ^0.8.12; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; |
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
pragma solidity 0.5.2; | |
contract Splitter { | |
uint public constant MAX = 100; | |
mapping(address => uint) public balances; | |
mapping(address => uint) public shares; | |
function deposit(uint share) external payable { | |
require(balances[msg.sender] == 0); | |
require(share <= MAX); |
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
pragma solidity 0.5.2; | |
contract EtherOrDollars { | |
mapping(address => uint) public balances; | |
mapping(address => bool) public eth; | |
function deposit(bool _eth) external payable { | |
require(balances[msg.sender] == 0); | |
balances[msg.sender] = msg.value; | |
eth[msg.sender] = _eth; |