Skip to content

Instantly share code, notes, and snippets.

View alejoacosta74's full-sized avatar

Alejo alejoacosta74

  • Argentina
View GitHub Profile

Tron Testnet Integration Test Failure - Root Cause Analysis

Executive Summary

The Tron testnet integration CI test is failing due to a test infrastructure timing bug, not a protocol bug. The test incorrectly captures "initial" balance after settlement operations have completed, causing balance verification to fail.

Status: ❌ CI Failing
Impact: Blocks deployment pipeline
Effort to Fix: Low (test script modification)
Business Risk: None (protocol logic is correct)

@alejoacosta74
alejoacosta74 / send_qtum.js
Created October 26, 2023 18:33
javascript to send QTUM using qtum-ethers-wrapper
// This program is used to send Qtum from one address to another.
// The `from` address is derived from the private key, which will be parsed from the environment variable `PRIVATE_KEY`,
// or from the .env file if it exists.
// The provider is read from the environment variable `PROVIDER`, or from the .env file if it exists.
// Syntax: node send_qtum.js <to_address> <amount>
// Example: node send_qtum.js 55fe1751d200b06fd76f14f6bde67c9f5e230785 2
const dotenv = require("dotenv");
dotenv.config();
const { QtumProvider, QtumWallet } = require("qtum-ethers-wrapper");
const BigNumber = require("bignumber.js");
@alejoacosta74
alejoacosta74 / interface.go
Last active February 1, 2024 23:23
golang logger
package log
import (
"github.com/sirupsen/logrus"
)
type Logger interface {
Trace(keyvals ...interface{})
Tracef(msg string, args ...interface{})
Debug(keyvals ...interface{})
@alejoacosta74
alejoacosta74 / bitcoin_ec_key_generation.py
Created February 12, 2022 14:54
Pyton script to generate bitcoin public key from private key using ECC
# Super simple Elliptic Curve Presentation. No imported libraries, wrappers, nothing.
# For educational purposes only. Remember to use Python 2.7.6 or lower. You'll need to make changes for Python 3.
# Original source: https://github.com/wobine/blackboard101/blob/master/EllipticCurvesPart4-PrivateKeyToPublicKey.py
# secp256k1 domain parameters
Pcurve = 2**256 - 2**32 - 2**9 - 2**8 - 2**7 - 2**6 - 2**4 -1 # The proven prime
Acurve = 0; # These two defines the elliptic curve. y^2 = x^3 + Acurve * x + Bcurve
Bcurve = 7;
Gx = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798
Gy = 0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8
@alejoacosta74
alejoacosta74 / ERC20.sol
Created February 10, 2022 21:48
Implementation of ERC20 + EIP 2612 Permit
pragma solidity =0.5.16;
import './interfaces/IUniswapV2ERC20.sol';
import './libraries/SafeMath.sol';
contract UniswapV2ERC20 is IUniswapV2ERC20 {
using SafeMath for uint;
string public constant name = 'Uniswap V2';
string public constant symbol = 'UNI-V2';
@alejoacosta74
alejoacosta74 / eslint_prettier_airbnb.md
Created June 29, 2021 14:37 — forked from bradtraversy/eslint_prettier_airbnb.md
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
@alejoacosta74
alejoacosta74 / app.js
Last active October 1, 2021 14:44
Node.js and python scripts to load into web3 wallet the private key generated by Geth CLI command:
const Wallet = require('ethereumjs-wallet');
const fs = require('fs');
const homedir = require('os').homedir();
const utcFile = homedir.concat('/.ethereum/rinkeby/keystore/UTC--2021-06-07T23-53-17.245981261Z--3633aaa1151d44729272acce363c66f5da51e16a');
const password = "12345";
var myWallet;
(async () => {
myWallet = await Wallet.default.fromV3(fs.readFileSync(utcFile).toString(), password, true);
console.log("Private Key: " + myWallet.getPrivateKey().toString('hex')) ;
@alejoacosta74
alejoacosta74 / app.js
Created May 29, 2021 22:23
Use axios to send graphQL query through a post request to the https endpoint provided by The Graph
const axios = require('axios')
axios.post('https://api.thegraph.com/subgraphs/name/aave/protocol', {
query: `
{
flashLoans(first: 10, orderBy: timestamp, orderDirection: desc) {
id
reserve {
name
symbol
@alejoacosta74
alejoacosta74 / x509-pub-vs-private-key-comparison.sh
Last active October 1, 2021 14:42
openssl commands to cross check that private key matches x509 certificate
#Ouputs public key from private key
openssl pkey -in privateKey.key -pubout -outform pem | sha256sum
#Extracts public key from x509 certificate
openssl x509 -in certificate.crt -pubkey -noout -outform pem | sha256sum
#Extracts public key from CSR (Certificate Signing Request)
openssl req -in CSR.csr -pubkey -noout -outform pem | sha256sum