Skip to content

Instantly share code, notes, and snippets.

View JGcarv's full-sized avatar
:shipit:
That doesn't look like anything to me

Joao Gabriel Carvalho JGcarv

:shipit:
That doesn't look like anything to me
View GitHub Profile
@JGcarv
JGcarv / SecretVariable.sol
Last active October 17, 2018 20:10
Secret Variable
pragma solidity 0.4.24;
contract SecretVariable {
uint256 secret;
uint256 public guess;
constructor(uint256 _secret) {
secret = _secret;
}
@JGcarv
JGcarv / TokenExchange.sol
Created October 17, 2018 18:33
ERC20 Token Exchange
pragma solidity 0.4.24;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
contract ERC20Exchange {
pragma solidity 0.4.21;
import "./Utils/SafeMath.sol";
contract ExampleToken{
using SafeMath for uint256;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);