Skip to content

Instantly share code, notes, and snippets.

@m-kus
m-kus / novalidate.cairo
Created December 27, 2024 12:46
NoValidate account contract
#[starknet::interface]
pub trait ValidateDeploy<TContractState> {
fn __validate_deploy__(
self: @TContractState,
class_hash: felt252,
contract_address_salt: felt252,
public_key: felt252
) -> felt252;
}
# Useful Python 2.x script for Tezos bakers to calculate payouts for their delegators
# This is a highly edited payout calculation script which aims to be a bit friendlier while giving more information.
# Original credit goes to /u/8x1_ from https://reddit.com/r/tezos/comments/98jwb4/paypy_there_is_no_more_excuse_for_not_paying/
# Released under the MIT License - See bottom of file for license information
import urllib
import json
import random
import sys
@m-kus
m-kus / fa_token_balance_updates.ipynb
Last active May 31, 2020 10:52
Deriving FA token balance_updates from big_map_diff
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@m-kus
m-kus / lmdb_big_map.ipynb
Last active March 18, 2020 14:49
Extracting raw big map values from lmdb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
cls.my = ContractInterface.create_from(join(project_dir, 'src/my_contract.tz'),
factory=NonFungibleTokenImpl)
cls.my = ContractInterface.create_from(join(dirname(__file__), 'my_contract.tz'),
shell='sandboxnet')
def test_concat(self):
res = self.my.call('bar').result(storage='foo')
self.assertEqual('foobar', res.storage)
parameter string;
storage string;
code { DUP;
DIP { CAR ; NIL string ; SWAP ; CONS } ;
CDR ; CONS ;
CONCAT ;
NIL operation; PAIR }
from os.path import dirname, join
from unittest import TestCase
from decimal import Decimal
from pytezos import ContractInterface, pytezos, format_timestamp, MichelsonRuntimeError
class MyContractTest(TestCase):
@classmethod
def setUpClass(cls):
@m-kus
m-kus / pytezos_tx_params.ipynb
Created September 11, 2019 13:59
Encoding transaction parameters with PyTezos
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.