Skip to content

Instantly share code, notes, and snippets.

View jtakalai's full-sized avatar
💭
^_________^

jtakalai

💭
^_________^
View GitHub Profile
@jtakalai
jtakalai / 6e5117e7810cf9123b9fe6ad3edf861c.json
Created May 31, 2024 09:27
Standard-JSON-Input of StreamRegistryV5
This file has been truncated, but you can view the full file.
{"id":"6e5117e7810cf9123b9fe6ad3edf861c","_format":"hh-sol-build-info-1","solcVersion":"0.8.9","solcLongVersion":"0.8.9+commit.e5eed63a","input":{"language":"Solidity","sources":{"@chainlink/contracts/src/v0.8/Chainlink.sol":{"content":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport {CBORChainlink} from \"./vendor/CBORChainlink.sol\";\nimport {BufferChainlink} from \"./vendor/BufferChainlink.sol\";\n\n/**\n * @title Library for common Chainlink functions\n * @dev Uses imported CBOR library for encoding to buffer\n */\nlibrary Chainlink {\n uint256 internal constant defaultBufferSize = 256; // solhint-disable-line const-name-snakecase\n\n using CBORChainlink for BufferChainlink.buffer;\n\n struct Request {\n bytes32 id;\n address callbackAddress;\n bytes4 callbackFunctionId;\n uint256 nonce;\n BufferChainlink.buffer buf;\n }\n\n /**\n * @notice Initializes a Chainlink request\n * @dev Sets the ID, callback address, and callback function signature on the request\n *
@jtakalai
jtakalai / jobspec.toml
Created January 13, 2022 13:28
Chainlink Direct Request attempt
type = "directrequest"
schemaVersion = 1
name = "Get > Bytes32"
contractAddress = "0x214859dE825FA80f3977EBc31F55Bc09e82565f0"
maxTaskDuration = "20s"
observationSource = """
decode_log [type="ethabidecodelog"
abi="OracleRequest(bytes32 indexed specId, address requester, bytes32 requestId, uint256 payment, address callbackAddr, bytes4 callbackFunctionId, uint256 cancelExpiration, uint256 dataVersion, bytes data)"
data="$(jobRun.logData)"
topics="$(jobRun.logTopics)"]
@jtakalai
jtakalai / log.txt
Created November 5, 2019 10:02
Complex power tower
> c=new C(-0.8); x=c; res=[]; for (let i = 0; i < 10; i++) res.push(x = x.pow(c)); res
[ { re: -0.967131781178879, im: -0.7026623692120304 },
{ re: -0.3691153675094393, im: 0.7844100843322339 },
{ re: -0.042251892773906244, im: -1.120235261735242 },
{ re: 0.2557231881056781, im: 0.8760941991244778 },
{ re: 0.5543917466943977, im: -0.9220211474369996 },
{ re: 0.6410070262045503, im: 0.6918834867768658 },
{ re: 0.8285847445893876, im: -0.6415296186745002 },
{ re: 0.8325254334492322, im: 0.4845217029269798 },
{ re: 0.940151752960039, im: -0.4217163364065653 },

Keybase proof

I hereby claim:

  • I am jtakalai on github.
  • I am jtakalai (https://keybase.io/jtakalai) on keybase.
  • I have a public key ASCYwPWgIZ_Gw3zmcKlAwRsXrr_rfp5AqI55eziLhyghLAo

To claim this, I am signing this object:

@jtakalai
jtakalai / Testing.sol
Created November 19, 2018 08:25
Testing "continue" keyword to replicate whas was reported fixed in https://solidity.readthedocs.io/en/latest/050-breaking-changes.html
pragma solidity ^0.4.22;
/** @dev herp derp */
contract Testing {
event Show(bytes s);
bytes32[] derp;
function continueTest() public {
derp.push(0x123);
derp.push(0x0);
@jtakalai
jtakalai / SimpleToken.sol
Created September 17, 2018 12:42
A simple token (not ERC20 compliant)
pragma solidity ^0.4.24;
contract SimpleToken {
string public constant name = "My Simple Token";
string public constant symbol = "TEST";
uint8 public constant decimals = 18; // same as ether
mapping (address => uint256) public balanceOf;
event Transfer(address indexed from, address indexed to, uint tokens);
@jtakalai
jtakalai / startConsole.js
Created April 3, 2018 16:05
Homegrown Ethereum console
// Helper functions for an "ethereum console", similar to geth --attach
var _ = require("lodash")
var Table = require("cli-table")
var BN = require("bignumber.js")
var Web3 = require("web3")
var web3 = new Web3()
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'))
@jtakalai
jtakalai / ponzicoin_profits.txt
Created January 29, 2018 11:26
PonziCoin profit calculation
calculation in browser console:
var fyffe = 0, velka = 0, tokenit = 0, p = 1; for (var i = 1; i < 10; i++) { fyffe += p * 100; tokenit += 100; velka = p * tokenit / 4; console.log("Fyffe: " + fyffe + ", tokenit: " + tokenit + ", velka: " + velka + ", profit: " + (fyffe - velka)); p = p * 2; }
console output:
Fyffe: 100, tokenit: 100, velka: 25, profit: 75
Fyffe: 300, tokenit: 200, velka: 100, profit: 200
Fyffe: 700, tokenit: 300, velka: 300, profit: 400
Fyffe: 1500, tokenit: 400, velka: 800, profit: 700
Fyffe: 3100, tokenit: 500, velka: 2000, profit: 1100
Fyffe: 6300, tokenit: 600, velka: 4800, profit: 1500
@jtakalai
jtakalai / UbiToken.sol
Last active September 18, 2018 09:32
ERC20 compatible token with an added feature
pragma solidity ^0.4.24;
// Token standard interface
contract ERC20 {
// Basic token features: book of balances and transfer
uint public totalSupply = 0;
mapping (address => uint256) public balanceOf;
function transfer(address to, uint tokens) public returns (bool success);
// Advanced features: An account can approve another account to spend its funds
@jtakalai
jtakalai / Puzzle.sol
Last active November 8, 2018 08:30
What does this contract do? Can you spot a bug?
pragma solidity ^0.4.0;
contract Puzzle {
address _a;
address _b;
constructor(address a, address b) public {
_a = a;
_b = b;
}