Skip to content

Instantly share code, notes, and snippets.

View hiddentao's full-sized avatar
🌱

Ramesh Nair hiddentao

🌱
View GitHub Profile
@Aboudjem
Aboudjem / Create.sol
Last active March 25, 2024 19:29
Create, Create2, Create3
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract Template {
uint256 variable1;
}
contract Create {
@nadilas
nadilas / index.js
Created May 28, 2022 09:33
Logtail flush in NextJS api endpoint
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import { Node as Logtail } from '@logtail/js';
const logger = new Logtail(process.env.LOGTAIL_SOURCE_TOKEN);
export default async function handler(req, res) {
const user = {
id: 123,
name: 'John Doe',
@alexvandesande
alexvandesande / ethernalsale.js
Last active October 21, 2021 04:40
This is a first draft at what could be a continuous token sale. I just wrote it and haven't tested it but it shows the proof of concept: tokens are continuously generated in any curve desired and sold for the highest bidder. Since there's a maximum token sale speed, this guarantees that sales can't end too quickly. Since the sale always starts f…
pragma solidity ^0.4.2;
contract ethernalSale {
struct order {
uint amount;
address buyer;
}
mapping (uint => order) orderBook;
mapping (address => uint) balanceOf;
/**
* Base contract that all upgradeable contracts should use.
*
* Contracts implementing this interface are all called using delegatecall from
* a dispatcher. As a result, the _sizes and _dest variables are shared with the
* dispatcher contract, which allows the called contract to update these at will.
*
* _sizes is a map of function signatures to return value sizes. Due to EVM
* limitations, these need to be populated by the target contract, so the
* dispatcher knows how many bytes of data to return from called functions.