Skip to content

Instantly share code, notes, and snippets.

View gretzke's full-sized avatar

Daniel Gretzke gretzke

View GitHub Profile
@gretzke
gretzke / PolygonCarV31.sol
Created January 29, 2023 19:44
0xMonaco 2nd place car
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./../interfaces/ICar.sol";
enum Status {
EARLY_GAME,
LATE_GAME
}
@gretzke
gretzke / fungible.kt
Last active November 19, 2019 10:49
Fungible Token + Contract + Flow
class ESTContract: FungibleTokenContract(), Contract {
}
@BelongsToContract(ESTContract::class)
data class ESTFungible(override val amount: Amount<IssuedTokenType>,
override val holder: AbstractParty,
override val tokenTypeJarHash: SecureHash? = amount.token.tokenType.getAttachmentIdForGenericParam()
): FungibleToken(amount, holder, tokenTypeJarHash) {
@gretzke
gretzke / ecrecover.sol
Created January 27, 2019 01:04
Ethereum message signature recovery
pragma solidity ^0.5.2;
contract Ecrecover {
function recover(bytes32 message, bytes memory sig) public pure returns(address) {
(uint8 v, bytes32 r, bytes32 s) = splitSignature(sig);
return ecrecover(message, v, r, s);
}
@gretzke
gretzke / array_gas.sol
Last active December 18, 2018 00:04
array gas estimation
pragma solidity ^0.4.24;
contract Test {
uint256[] x = [1,2,3];
uint256[] y = [1];
uint256[] x1 = [1,2,3];
uint256[] y1 = [1];
function testx() public {
var price = 50000000000000000;
status.command({
name: 'hours',
description: 'How many hours do you want to book the ...?',
color: '#CCCCCC',
sequentialParams: true,
params: [{
name: 'hours',
type: status.types.NUMBER,
var booked;
var price = 0;
status.command({
name: "start",
description: "Start a new session",
color: "#CCCCCC",
handler: function (params) {
return {
"text-message": {
0xa0027Dc549b38fb24fc62619c1A7e276CB157F04
0x279319821c3762350aCD513011C764Dbe5FeF31e