Skip to content

Instantly share code, notes, and snippets.

async function getContractAbiFromEtherscan(contractAddress: string): Promise<string> {
const url = `https://api.etherscan.io/api?module=contract&action=getabi&address=${contractAddress}`;
const response = await axios.get(url);
return response.data.result;
}
@alexkroeger
alexkroeger / comp proposal 65, diff in comptrollerStorage.sol.diff
Created October 12, 2021 00:37
a=0x234B619B4f4E405665F7d94F2CE60c24256032B5, b=0xBafE01ff935C7305907c33BF824352eE5979B526
diff --git a/old_comptrollerstorage.sol b/new_comptrollerstorage.sol
index fdf1eed..b74db65 100644
--- a/old_comptrollerstorage.sol
+++ b/new_comptrollerstorage.sol
@@ -151,3 +151,11 @@ contract ComptrollerV6Storage is ComptrollerV5Storage {
/// @notice The rate at which comp is distributed to the corresponding supply market (per block)
mapping(address => uint) public compSupplySpeeds;
}
+
+contract ComptrollerV7Storage is ComptrollerV6Storage {
@alexkroeger
alexkroeger / comp proposal 65, diff in comptroller.sol.diff
Last active October 11, 2021 23:52
a=0x234B619B4f4E405665F7d94F2CE60c24256032B5, b=0xBafE01ff935C7305907c33BF824352eE5979B526
diff --git a/old_comptroller.sol b/new_comptroller.sol
index 13ddf7b..4399c3f 100644
--- a/old_comptroller.sol
+++ b/new_comptroller.sol
@@ -12,7 +12,7 @@ import "./Governance/Comp.sol";
* @title Compound's Comptroller Contract
* @author Compound
*/
-contract Comptroller is ComptrollerV6Storage, ComptrollerInterface, ComptrollerErrorReporter, ExponentialNoError {
+contract Comptroller is ComptrollerV7Storage, ComptrollerInterface, ComptrollerErrorReporter, ExponentialNoError {
@alexkroeger
alexkroeger / comp proposal 64, diff in comptroller.sol.diff
Last active October 2, 2021 16:09
a= 0x374abb8ce19a73f2c4efad642bda76c797f19233, b=0x234B619B4f4E405665F7d94F2CE60c24256032B5
diff --git a/old_comptroller.sol b/new_comptroller.sol
index 9ba55ab..13ddf7b 100644
--- a/old_comptroller.sol
+++ b/new_comptroller.sol
@@ -1077,39 +1077,6 @@ contract Comptroller is ComptrollerV6Storage, ComptrollerInterface, ComptrollerE
function _become(Unitroller unitroller) public {
require(msg.sender == unitroller.admin(), "only unitroller admin can change brains");
require(unitroller._acceptImplementation() == 0, "change not authorized");
-
- // TODO: Remove this post upgrade
@alexkroeger
alexkroeger / comp proposal 63, diff in comptroller.sol.diff
Last active October 2, 2021 16:08
a=0x374abb8ce19a73f2c4efad642bda76c797f19233, b=0x7102A09B55A6e39B75DEd6073a2e0337255abf02
diff --git a/old_comptroller.sol b/new_comptroller.sol
index 9ba55ab..e079d10 100644
--- a/old_comptroller.sol
+++ b/new_comptroller.sol
@@ -1077,39 +1077,6 @@ contract Comptroller is ComptrollerV6Storage, ComptrollerInterface, ComptrollerE
function _become(Unitroller unitroller) public {
require(msg.sender == unitroller.admin(), "only unitroller admin can change brains");
require(unitroller._acceptImplementation() == 0, "change not authorized");
-
- // TODO: Remove this post upgrade
@alexkroeger
alexkroeger / diff_delegate
Last active August 23, 2021 02:13
Uniswap Proposal 8 Contract Diffs
diff --git a/compound_governorbravodelegate.sol b/uniswap_governorbravodelegate.sol
index 7c574ec..2ac6dfe 100644
--- a/compound_governorbravodelegate.sol
+++ b/uniswap_governorbravodelegate.sol
@@ -6,13 +6,13 @@ import "./GovernorBravoInterfaces.sol";
contract GovernorBravoDelegate is GovernorBravoDelegateStorageV1, GovernorBravoEvents {
/// @notice The name of this contract
- string public constant name = "Compound Governor Bravo";
+ string public constant name = "Uniswap Governor Bravo";
diff --git a/contracts/zero-ex/contracts/src/errors/LibNativeOrdersRichErrors.sol b/contracts/zero-ex/contracts/src/errors/LibNativeOrdersRichErrors.sol
index e339caac4..a12ab1428 100644
--- a/contracts/zero-ex/contracts/src/errors/LibNativeOrdersRichErrors.sol
+++ b/contracts/zero-ex/contracts/src/errors/LibNativeOrdersRichErrors.sol
@@ -88,6 +88,21 @@ library LibNativeOrdersRichErrors {
);
}
+ function InvalidSignerError(
+ address maker,

Keybase proof

I hereby claim:

  • I am alexkroeger on github.
  • I am kroeger0x (https://keybase.io/kroeger0x) on keybase.
  • I have a public key ASDuAtSyjbN5qMJlEwJwfdaMohvM-E5mS-Prt2OmSihpdAo

To claim this, I am signing this object:

@alexkroeger
alexkroeger / getExchangeCost() tx failures
Created July 23, 2019 00:02
BigQuery Query to get dYdX tx failures due to getExchangeCost() reverts
WITH
wrapper_tx AS (
SELECT DISTINCT
t.transaction_hash
FROM `bigquery-public-data.crypto_ethereum.traces` t
LEFT JOIN `bigquery-public-data.crypto_ethereum.transactions` tx ON tx.hash = t.transaction_hash
WHERE
-- 0x V2 contracts
LOWER(t.to_address) IN ('0x080bf510fcbf18b91105470639e9561022937712','0x4f833a24e1f95d70f028921e27040ca56e09ab0b')
-- dYdX 0x exchange wrappers