Skip to content

Instantly share code, notes, and snippets.

View luisnaranjo733's full-sized avatar

Luis Naranjo luisnaranjo733

View GitHub Profile
@luisnaranjo733
luisnaranjo733 / ChangeOwner.sol
Created January 28, 2022 23:19
Failed transaction - ethernaut secret number
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ISecretNumber {
function changeOwner(uint8 secretNumber) payable external;
}
// Contract deployed on Rinkeby at 0x0E3E2e9e2054bfC7B169D9c0e640E314d42C6a9a
// Call to changeOwner() fails despite more than enough balance being deposited
@luisnaranjo733
luisnaranjo733 / index.ts
Created January 28, 2022 20:18
Ethernauts Token challenge solution
/* eslint-disable prettier/prettier */
import { expect } from "chai";
import { BigNumber } from "ethers";
import { ethers } from "hardhat";
describe("Token", function () {
it("Underflow attack to drain token balance", async function () {
const INITIAL_SUPPLY = 10000;
const ATTACKER_INITIAL_BALANCE = 20;
@luisnaranjo733
luisnaranjo733 / besu-kintsugi-issue.md
Created January 15, 2022 15:32
Besu failing to start - Kintsugi testnet

Issue running Besu on Kintsugi

Hi! I'm working on a write-up to walk people through the instructions for how they can run a node on Kintsugi to test the merge using a minority client. My goal is to promote the Besu-Teku client combination, since I believe it is underrated and has lots of benefits (can compile both with the same programming language, synergy between dev teams, less supply chain attack vectors, etc...)

However, after following the official instructions from the Kintsugi testnet website, I am running into issues I have not been able to solve myself.

Branch used:

@luisnaranjo733
luisnaranjo733 / adjust.d.ts
Created September 29, 2018 00:52
Example typings for Adjust RN SDK
declare module "react-native-adjust" {
type Environment = "sandbox" | "production";
export class AdjustConfig {
constructor(appToken: string, environment: Environment) {}
static get EnvironmentSandbox(): Environment {
return "sandbox";
}
static get EnvironmentProduction(): Environment {
@luisnaranjo733
luisnaranjo733 / django.conf
Created May 19, 2017 17:23
Nginx config file
upstream web {
ip_hash;
server web:80;
}
# portal
server {
location /static/ {
autoindex on;
alias /static/;
@luisnaranjo733
luisnaranjo733 / docker-compose.yml
Created May 19, 2017 17:21
docker-compose.yml
version: '2'
services:
nginx:
image: nginx:latest
container_name: ng01
ports:
- "80:80"
volumes:
- ./src:/src
- ./config/nginx:/etc/nginx/conf.d
@luisnaranjo733
luisnaranjo733 / .block
Created May 16, 2017 20:01 — forked from mbostock/.block
Choropleth
license: gpl-3.0
height: 600
border: no
@luisnaranjo733
luisnaranjo733 / example.js
Created April 24, 2017 01:47
How to make POST requests in JS
let data = new FormData();
data.append('note', 'new note value yo!');
let youth_visit_id = 1;
let url = `/api/visit/${youth_visit_id}/edit-note/`;
fetch(url, {
method: 'POST',
body: data
}).then(response => {
@luisnaranjo733
luisnaranjo733 / web.Dockerfile
Created March 29, 2017 01:07
web dockerfile
FROM python:3.6
ENV PYTHONUNBUFFERED 1
RUN mkdir /config
ADD /config/requirements.txt /config/
RUN pip install -r /config/requirements.txt
RUN mkdir /src;
WORKDIR /src
FROM node:6.10.1
RUN mkdir /src;
WORKDIR /src