Skip to content

Instantly share code, notes, and snippets.

View encody's full-sized avatar
☠️
Only mostly dead

Jacob Lindahl encody

☠️
Only mostly dead
View GitHub Profile
@encody
encody / index.ts
Created February 26, 2021 14:02
near-wagers-contract
import {
context,
env,
logging,
PersistentMap,
PersistentUnorderedMap,
storage,
u128,
} from 'near-sdk-as';
import { AccountId, SymbolId, Wager, WagerId } from './model';
pragma solidity ^0.8.4;
contract Attack {
function contractBalance () external view returns (uint256) {
return address(this).balance;
}
function performAttack1 (address contractAddress) external payable {
InconspicuousToken i = InconspicuousToken(contractAddress);
i.buy{ value: msg.value }();
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
import Control.Arrow
import Data.Map (Map)
import qualified Data.Map as Map
import GHC.Base (assert)
import GHC.IO
import System.IO ()
@encody
encody / StorageTest.sol
Last active December 3, 2021 22:47
storage, memory, calldata comparison in Solidity
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;
contract StorageTest {
struct ComplexStruct {
uint256 x;
uint256 y;
}
@encody
encody / main.rs
Created June 1, 2022 18:44
Introduction to Rust - NU Workshop
fn main() { // 'a
// Printing to the screen
println!("Hello, world!");
// Variables & mutability
let mut x: u128 = 1;
x = x + 1;
println!("x is {x}");
// Arrays, vectors, ranges, and loops
@encody
encody / main.rs
Created June 9, 2022 18:03
Introduction to Rust Workshop @near HH ATX
fn main() {
// Printing to the screen
println!("Hello, world!");
// Variables & mutability
let mut x = 1;
x = 4;
// Arrays, vectors, ranges, and loops
let x = 5;
@encody
encody / nocturne-v1_attestation.log
Created October 30, 2023 15:00
Attestation for nocturne-v1 MPC Phase 2 Trusted Setup ceremony
Hey, I'm encody-7459638 and I have contributed to the nocturne-v1 MPC Phase2 Trusted Setup ceremony.
The following are my contribution signatures:
Circuit # 1 (canonaddrsigcheck)
Contributor # 33
Contribution Hash: 6c67bc64 aeb6bbef 6008c276 165dd45c
d26eb929 4415e388 e2e3a4ed 9a21819f
0b46e013 e4b8fa1b b79066a7 78761b45
3b51da8d 1ced817d 47b11e24 2e7171bc
@encody
encody / lib.rs
Created February 10, 2024 05:44
NEAR Spinner
use near_sdk::{
borsh::{self, BorshDeserialize, BorshSerialize},
env,
json_types::U64,
log, near_bindgen, Promise,
};
#[derive(BorshSerialize, BorshDeserialize, Default, Debug)]
#[near_bindgen]
struct Contract {}