-
Commit: https://github.com/SpoolFi/spool-v2-core/commit/86065428a4d5e6de3c7b10909db532033c578c80
-
Description:
-
Acknowledged, implemented in the commit hash above.
-
the
_redeemFromProtocol()
function now uses just one slippage value, for the output WETH amount. We pass an empty array to redeem inner for the slippages, as we assume that we will catch any issues on the output WETH amount. We must allow passing slippages to_redeemInner
, as in theemergencyWithdraw
function, we will just get back stETH and frxETH and send to the emergency recipient, and so we still want to use slippages for stETH and frxETH in this case. I've updated theredeemFast
/emergencyWithdraw
description, to better relate this. -
In this commit, I have also included some event emissions that we missed:
-
-
in
assetGroupWrap
, we return aratio
array, which represents the amounts of stETH/frxETH that's used as input t
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cd ~/.geth/ | |
# Add following script here | |
# Create ~/.geth/keys, ~/geth/dev | |
# Add keys 0.txt,1.txt..N.txt, and passwords.txt, with each line in passwords.txt representing password for that account | |
# import into ~/geth/dev: geth account import --datadir ~/.geth/chain ~/.geth/dev/0.txt etc., enter same password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { ethers } = require("ethers"); | |
BigNumber = ethers.BigNumber | |
module.exports = { | |
WAD: ethers.utils.parseUnits('1'), | |
//rounds to zero if x*y < WAD / 2 | |
wmul: function(x, y) { | |
return x.mul(y).add(WAD.div(2)).div(WAD); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from etherscan import Etherscan | |
import os | |
import json | |
from time import sleep | |
# setup | |
ethscan = Etherscan('YOUR_API_KEY_HERE') | |
# NOTE: must be a multi-verified contract to work. Staked Aave used as example here | |
address = "0x4da27a545c0c5b758a6ba100e3a049001de870f5" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {task, types} from "hardhat/config"; | |
task("test-fork", "Runs mocha tests on a fork of mainnet").addOptionalParam( | |
"url", | |
"The URL of the Mainnet archive node", | |
"", | |
types.string | |
).setAction(async (taskArgs, hre) => { | |
hre.config.networks.hardhat.forking = { | |
url: taskArgs.url, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
architecture is like so: | |
Struct struct { | |
... | |
mapping(address => uint) map; | |
... | |
} | |
contract X { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requirements: | |
# jq | |
# abi2solidity | |
cat Contract.json | jq '.abi' > Contract.abi.json | |
abi2solidity -i Contract.abi.json -o IContract.sol |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# will skip already created folders, just need to prepend new version names. | |
versions=(0.8.17 0.8.16 0.8.15 0.8.14 0.8.13 0.8.12 0.8.11 0.8.10 0.8.9 0.8.8 0.8.7 0.8.6 0.8.5 0.8.4 0.8.3 0.8.2 0.8.1 0.8.0 0.7.6 0.7.5 0.7.4 0.7.3 0.7.2 0.7.1 0.7.0 0.6.12 0.6.11 0.6.10 0.6.9 0.6.8 0.6.7 0.6.6 0.6.5 0.6.4 0.6.3 0.6.2 0.6.1 0.6.0 0.5.17 0.5.16 0.5.15 0.5.14 0.5.13 0.5.12 0.5.11 0.5.10 0.5.9 0.5.8 0.5.7 0.5.6 0.5.5 0.5.4 0.5.3 0.5.2 0.5.1 0.5.0 0.4.26 0.4.25 0.4.24 0.4.23 0.4.22 0.4.21 0.4.20 0.4.19 0.4.18 0.4.17 0.4.16 0.4.15 0.4.14 0.4.13 0.4.12 0.4.11 0.4.10) | |
for i in "${versions[@]}" | |
do | |
mkdir $i && cd $i && wget https://github.com/ethereum/solidity/releases/download/v$i/solc-static-linux && mv solc-static-linux solc && chmod +x solc && cd .. | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ethers } from "ethers"; | |
async function setBalance(account: string, token: string, slot: number){ | |
const paddedSlot = ethers.utils.hexZeroPad(ethers.utils.hexlify(slot), 32); | |
const paddedKey = ethers.utils.hexZeroPad(account, 32); | |
const itemSlot = ethers.utils.keccak256(paddedKey + paddedSlot.slice(2)); | |
const storageSlot = ethers.utils.hexStripZeros(itemSlot); | |
await ethers.provider.send("anvil_setStorageAt", [ | |
token, | |
storageSlot, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import TransportNodeHid from "@ledgerhq/hw-transport-node-hid"; | |
import Eth from "@ledgerhq/hw-app-eth"; | |
import BIP32Factory from 'bip32'; | |
import * as ecc from 'tiny-secp256k1'; | |
import publicKeyToAddress from 'ethereum-public-key-to-address'; | |
const bip32 = BIP32Factory(ecc); | |
const PATH = "44'/60'/0'"; | |
const RANGE = 10; |