Skip to content

Instantly share code, notes, and snippets.

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

fbslo fbslo

🏠
Working from home
View GitHub Profile
@fbslo
fbslo / oracle.md
Last active November 13, 2020 06:26
Welcome file

Wrapped Hive Engine Tokens

As some of you might be aware, I've been working on Wrapped tokens for the last 3 months. First Wrapped Hive, then modified oracle for wLEO and now I'm presenting an out-of-a-box solution for anyone to create their own Hive Engine Wrapped Token. It's meant mostly for "owners" of HE tribes, but anyone can start one if they want.

I tried to make setup as easy as possible, but you will still need to follow some instructions. But it's as close to no-code as possible. I tried to create the same experience as the hive-in-a-box does for the witness setup.

var Twit = require('twit')
const CONSUMER_KEY=''
const CONSUMER_SECRET=''
const ACCESS_TOKEN=''
const ACCESS_TOKEN_SECRET=''
var T = new Twit({
consumer_key: CONSUMER_KEY,
consumer_secret: CONSUMER_SECRET,
// File: node_modules\@openzeppelin\contracts\token\ERC20\IERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
// File: node_modules\@openzeppelin\contracts\token\ERC20\IERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
{
"name": "uniswap",
"timestamp": "2021-03-28T14:37:21.973Z",
"version": {
"major": 1,
"minor": 3,
"patch": 1
},
"tags": {},
"logoURI": "/images/coins/wbnb.png",
async function sendTx(){
let accounts = await ethereum.request({ method: 'eth_requestAccounts' });
let your_address = ''
let amount = 1
const transactionParameters = {
nonce: '0x00', // ignored by MetaMask
to: your_address, // Required except during contract publications.
from: accounts[0], // must match user's active address.
chainId: 1, // Used to prevent transaction reuse across blockchains. Auto-filled by MetaMask.
gas: '0x186A0',
const ABI = [{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_token","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"DepositedFundingToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"Owners
//SPDX-License-Identifier: MIT
//2021, @fbsloXBT
pragma solidity ^0.8.4;
interface IUSDC {
function transfer(address to, uint256 amount) external returns(bool);
function transferFrom(address sender, address receiver, uint256 amount) external returns(bool);
}
pragma solidity ^0.8.6;
//SPDX-License-Identifier: UNLICENSED
/// @notice ERC20 token contract interface
interface IERC20 {
function transfer(address user, uint256 amount) external returns (bool);
}
contract TimelockDeposits {
/// @notice Owner address
const PRIVATE_KEY = ""
const TronWeb = require('tronweb')
const tronWeb = new TronWeb({
fullHost: 'https://api.trongrid.io',
privateKey: PRIVATE_KEY
})
const ethers = tronWeb.utils.ethersUtils;
var hexStr2byteArray = function(str) {