Skip to content

Instantly share code, notes, and snippets.

View SeptiyanAndika's full-sized avatar
🏠
Working from home

Septiyan Andika SeptiyanAndika

🏠
Working from home
View GitHub Profile
@SeptiyanAndika
SeptiyanAndika / update_opensea.py
Created April 30, 2022 00:03 — forked from sudo-owen/update_opensea.py
Update OpenSea metadata
import requests
import time
# change the address here to be your desired NFT
url = "https://api.opensea.io/asset/0xc17030798a6d6e1a76382cf8f439182eb0342d93/"
update_flag = "/?force_update=true"
ids = [ i for i in range(0, 180)]
for i in ids:
@SeptiyanAndika
SeptiyanAndika / hardhat-openzeppelin-project.md
Created December 18, 2021 21:59 — forked from alkavan/hardhat-openzeppelin-project.md
Hardhat and OpenZeppelin project bootstrap for Ethereum contract development

Install Instructions

Install Hardhat

npm install --save-dev hardhat

Initiate a new Hardhat project (in empty directory)

npx hardhat
@SeptiyanAndika
SeptiyanAndika / contracts...MinimalNFT.sol
Created July 19, 2021 08:55
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.8.6+commit.11564f7e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract MinimalNFT {
event Mint(address indexed _to, uint256 indexed _tokenId, bytes32 _ipfsHash);
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
uint256 tokenCounter = 1;
mapping(uint256 => address) internal idToOwner;
@SeptiyanAndika
SeptiyanAndika / contracts...BasicToken.sol
Created July 19, 2021 08:52
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.8.6+commit.11564f7e.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract BasicToken {
mapping(address => uint256) balances;
address owner;
{
"LQ45": ["BBCA", "UNVR", "BMRI", "INDF", "ICBP", "ADRO", "PGAS", "GGRM", "WIKA", "ANTM", "JPFA", "PTBA", "KLBF", "BBNI", "JSMR", "UNTR", "HMSP", "MNCN", "CPIN", "PTPP", "CTRA", "SMGR", "PWON", "ITMG", "BSDE", "ERAA", "INTP", "BBTN", "SCMA", "SMRA", "INKP", "ACES", "EXCL", "SRIL", "BTPS", "TKIM", "INCO", "AKRA", "TOWR", "MDKA", "TBIG", "MIKA", "TLKM", "BBRI", "ASII"],
"JII": ["UNVR", "INDF", "ICBP", "ADRO", "PGAS", "WIKA", "ANTM", "JPFA", "PTBA", "KLBF", "JSMR", "UNTR", "MNCN", "CPIN", "CTRA", "SMGR", "PWON", "ERAA", "INTP", "SCMA", "ACES", "EXCL", "BRPT", "BTPS", "INCO", "AKRA", "TPIA", "MDKA", "TLKM", "ASII"],
"MBX": ["BBCA", "UNVR", "BMRI", "INDF", "ICBP", "ADRO", "PGAS", "GGRM", "WSKT", "WIKA", "ANTM", "JPFA", "PTBA", "KLBF", "ADHI", "BBNI", "JSMR", "UNTR", "HMSP", "MNCN", "MYOR", "CPIN", "PTPP", "CTRA", "AALI", "SMGR", "LPPF", "PWON", "ITMG", "BSDE", "ERAA", "INTP", "BBTN", "SCMA", "SMRA", "INKP", "ACES", "EXCL", "GIAA", "LSIP", "HRUM", "BRPT", "SIDO", "INDY", "SRIL", "MEDC", "BTPS", "TKIM",
### POST /api/address [CREATE ADDRESS]
==== REQUEST ====
{
referenceId: xxxx,
coing:"BTC"
}
==== RESPONSE ====
{
Homebrew has a services manager and can manage its own Java installation, so an easier way to do this is just
# this will install java 1.8, zookeeper, and kafka
brew install kafka
# this will run ZK and kafka as services
brew services start zookeeper
brew services start kafka
That's it. If you want to stop Kafka, just run the brew services commands in reverse:
@SeptiyanAndika
SeptiyanAndika / IDEX.sol
Created July 9, 2019 02:00 — forked from dominiek/IDEX.sol
IDEX Smart Contract
pragma solidity ^0.4.16;
contract Token {
bytes32 public standard;
bytes32 public name;
bytes32 public symbol;
uint256 public totalSupply;
uint8 public decimals;
bool public allowTransactions;
mapping (address => uint256) public balanceOf;
pragma solidity >=0.4.22 <0.6.0;
interface ERC20Interface {
function transfer(address _to, uint256 _value) external returns (bool success);
function balanceOf(address _owner) external view returns (uint256 balance);
}
pragma solidity >=0.4.22 <0.6.0;
import "./ERC20Interface.sol";
contract SimpleWallet {
function flushTokens(address _tokenContractAddress,address _collectorAddress) public {
ERC20Interface instance = ERC20Interface(_tokenContractAddress);
address forwarderAddress = address(this);
uint256 forwarderBalance = instance.balanceOf(forwarderAddress);
if (forwarderBalance == 0) {