Skip to content

Instantly share code, notes, and snippets.

View dbeal-eth's full-sized avatar

dbeal dbeal-eth

View GitHub Profile
const MAX_FAIL = parseInt(args[0], 16);
const chainMapping = {
'11155111': [
`https://sepolia.infura.io/v3/${secrets.INFURA_API_KEY}`,
`https://rpc.sepolia.org`,
],
'10': [
`https://mainnet.optimism.io`,

Findings:

  • [CRITICAL[ infinite money printing glitch (see below)
  • [CRITICAL] LegacyMarket.sol does not implement the onERC721Received function. As a result, calling migrate will always revert as minting an account token to itself will fail.
  • [CRITICAL] Accounts with an unhealthy collateralization ratio cannot be migrated. During migration, the call to associateDebt will validate that the debt association does not put the account into a state that can be liquidated. As a result, an account on v2 that should be liquidated cannot be moved to v3 if the collateralization ratios are the same between the two systems.
    • our in-house k
const ethers = require('ethers');
const address = `${process.argv[2]}`;
const api = `${process.env.PROVIDER_URL}`;
const provider = new ethers.providers.JsonRpcProvider(api);
const ABI = require('./Synthetix.json');
const synthetixAddress = '0x8700daec35af8ff88c16bdf0418774cb3d7599b4';
@dbeal-eth
dbeal-eth / SystemMessenger.sol
Created December 16, 2021 21:46
theoretically cross chain messaging implementation
pragma solidity ^0.5.16;
// Inheritance
import "./Owned.sol";
import "./interfaces/IAddressResolver.sol";
import "./interfaces/ISystemMessenger.sol";
// https://docs.synthetix.io/contracts/source/contracts/systemstatus
contract SystemMessenger is Owned, ISystemMessenger {
@dbeal-eth
dbeal-eth / wei-and-bn.js
Last active September 21, 2022 03:57
Wei.js and bignumber.js
import { ethers } from 'ethers';
// import
import BigNumber from 'bignumber.js';
import Wei, { wei } from '@synthetixio/wei';
// construction (string)
let bigNum = new BigNumber('100000000000000000');
let weiNum = wei('1');
@dbeal-eth
dbeal-eth / BonusEmissionEscrow.sol
Last active June 5, 2021 20:14
Bonus Emission Escrow
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./interfaces/IERC20.sol";
import "./Owned.sol";
/**
* @title BonusEmissionEscrow
@dbeal-eth
dbeal-eth / subgraphs.md
Last active April 19, 2021 19:44
synthetix subgraphs update status
subgraph action taken
binary-options no refactor
chainlink merge into rates?
depot no refactor
exchanges add LatestRates
exchanger add LatestRates use templating
grantsdao no refactor
limit-orders merge into exchanges?
liquidations no refactor