Skip to content

Instantly share code, notes, and snippets.

View lajosdeme's full-sized avatar

lajosdeme

View GitHub Profile

Smart contract development principles

Principles for securely building smart contract systems collaboratively or individually.

Security first

The number one thing we are focusing on and optimizing, before anything else, is security. This means that before adding a line of code both the granular and the system-wide implications of that change must be deeply understood.

It is recommended to always use tools like the Olympix VSCode extension, and regularly run security analyzers like Mythril, Slither, etc.

The whole system must be regularly examined for complex, multi-step attacks like oracle or price manipulation.

@lajosdeme
lajosdeme / Centralized-PS.ipynb
Created December 6, 2023 23:44 — forked from stsievert/Centralized-PS.ipynb
PyTorch MNIST parameter server
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lajosdeme
lajosdeme / setup-hardhat.sh
Last active March 13, 2022 22:08
My simple Hardhat setup script for my Solidity projects. It downloads hardhat via npm, creates folders, and installs a few of my favourite plugins.
#!/bin/bash
# Simple script to preapre a project for smart contract development with hardhat.
# author: lajosdeme
# This will create an npm project, create folders for contracts, tests and scripts, and install the following dependencies:
# · hardhat
# · @openzeppelin/contracts
# · @nomiclabs/hardhat-ethers
# · @nomiclabs/hardhat-waffle
# · chai
@lajosdeme
lajosdeme / CoW.swift
Created March 2, 2020 13:28
Example of copy-on-write behavior in Swift
final class Person {
var name: String
init(name: String) {
self.name = name
}
}
struct PersonCOW {
private var person: Person
@lajosdeme
lajosdeme / InsertionSort.swift
Created February 10, 2020 18:07
Implementation of insertion sort algorithm in Swift
func insertionSort <T: Comparable>(array: inout [T]) {
if array.isEmpty {
return
}
for i in 1..<array.count {
var pos = i
let temp = array[i]
while pos > 0 && array[pos - 1] > temp {