Skip to content

Instantly share code, notes, and snippets.

View yosriady's full-sized avatar
💡
Optimize for Learning

Yos Riady yosriady

💡
Optimize for Learning
View GitHub Profile
[
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
@yosriady
yosriady / AccessControlledAggregator.sol
Created February 4, 2021 17:38
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=true&runs=100000&gist=
/**
*Submitted for verification at Etherscan.io on 2020-12-15
*/
pragma solidity 0.6.6;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
@yosriady
yosriady / SimpleToken.sol
Last active October 19, 2019 06:27
Sample code for 'Getting Started with Smart Contracts' talk at geekcamp.sg
pragma solidity ^0.5.11;
contract SimpleToken {
string public constant name = "GeekCamp Token";
string public constant symbol = "GEEK";
uint8 public constant decimals = 0;
address public minter;
mapping (address => uint) private _balances;
pragma solidity ^0.5.10;
interface ISimpleERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
function mint(address to, uint amount) external;
function balanceOf(address account) external view returns (uint);
function transfer(address to, uint amount) external returns (bool);
}
pragma solidity ^0.5.4;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20Mintable}.
*
* TIP: For a detailed writeup see our guide

Knowledge has a half-life. You should apply it, or it expires. Either we forget, or that knowledge becomes obsolete. Knowing something matters less than doing something consistently.

@yosriady
yosriady / README.md
Last active September 21, 2016 09:22
NUS Hackers Talk Proposal

Talk Title:

GraphQL in an Age of REST

Talk Description:

GraphQL is an application layer query language from Facebook. With GraphQL, you can define your backend as a well-defined graph-based schema. Then client applications can query your dataset as they are needed. GraphQL’s power comes from a simple idea — instead of defining the structure of responses on the server, the flexibility is given to the client. In this talk, discover a new approach to build and expose Web APIs. Will GraphQL do to REST what REST did to SOAP?

Keybase proof

I hereby claim:

  • I am yosriady on github.
  • I am yos (https://keybase.io/yos) on keybase.
  • I have a public key whose fingerprint is 4878 0825 CF03 CC90 FF13 624A EFCE 375C 3DFC DBDD

To claim this, I am signing this object:

@yosriady
yosriady / README.md
Last active September 5, 2016 05:19
NUS Hackers Talk Application

Talk Title:

Entity Component Systems in Elixir

Talk Description:

Entity-Component-System (ECS) is a distributed and compositional architectural design pattern that is mostly used in game development. Elixir is a dynamic, functional language built on top of the Erlang VM designed for building scalable and maintainable applications. In this talk, discover how we can use both ECS and Elixir in a novel approach to structure our programs beyond the traditional OO/inheritance paradigm. We'll cover:

@yosriady
yosriady / component.ex
Last active January 11, 2017 10:10
Entity Component System in Elixir
# A component is a minimal data object needed for a specific purpose.
# A component has no behaviour.
# A component class validates a given configuration and creates run-time data structures.
# Implemented as an Elixir Agent!
defmodule Component
@type options :: [key: type]
# Functions that have to be implemented by Components (if any)
@callback new(options) :: struct()