Skip to content

Instantly share code, notes, and snippets.

Piotr Kosiński kosecki123

Block or report user

Report or block kosecki123

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am kosecki123 on github.
  • I am piotrkosinski (https://keybase.io/piotrkosinski) on keybase.
  • I have a public key ASDEV0hBS6eUZ_qWJvbYdGpTyrj5OD3YHuMGSzWiwcdJ5Ao

To claim this, I am signing this object:

@kosecki123
kosecki123 / onchain_claiming_mechanism.R
Created Jun 18, 2018
onchain_claiming_mechanism.R using USD for target payout
View onchain_claiming_mechanism.R
set.seed(123)
tx_cost <- function(A_x, n, C_tx) {
(1 - A_x) * (n - 1) * C_tx
}
bounty <- function(timebounty, C_c, n) {
(timebounty - C_c) / n
}
@kosecki123
kosecki123 / onchain_claiming_mechanism.R
Created May 24, 2018
Simulation code for TimeNode expected payout
View onchain_claiming_mechanism.R
set.seed(123)
tx_cost <- function(A_x, n, C_tx) {
(1 - A_x) * (n - 1) * C_tx
}
bounty <- function(timebounty, C_c, n) {
(timebounty - C_c) / n
}
View callWithData.sol
contract Test1 {
function add(int a, int b) returns(bytes){ //Simply add the two arguments and return
return abi.encode(a+b);
}
}
contract Test2 {
Test1 test1;
function Test2(){
View gist:efd4138fbca88c4492d372e30254c834
function canExecute(bytes _serializedTransaction) public view returns(bool) {
address conditionalDest;
assembly {
conditionalDest := mload(add(_serializedTransaction, 320))
}
if (conditionalDest == 0x0) { //no conditional address set = no need to check
return true;
}
View canExecute.sol
function execute(bytes _serializedTransaction)
public returns (bool)
{
require(checkHash(_serializedTransaction));
require(canExecute(_serializedTransaction));
...
}
View callData.sol
function callWithData(address dest, bytes data)
private returns (bytes32 c)
{
assembly {
let freemem := mload(0x40)
pop(
call(
5000,
dest,
View eac.sol
pragma solidity ^0.4.21; // solhint-disable-line compiler-fixed
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
View keybase.md

Keybase proof

I hereby claim:

  • I am kosecki123 on github.
  • I am piotrkosinski (https://keybase.io/piotrkosinski) on keybase.
  • I have a public key ASDHMdBDja_f076GvZBft9G5jNxv28XGueH-Lx357TaAqQo

To claim this, I am signing this object:

You can’t perform that action at this time.