Skip to content

Instantly share code, notes, and snippets.

View rayeaster's full-sized avatar
💭
{@coding#//;}

Camotelli rayeaster

💭
{@coding#//;}
View GitHub Profile
@tschubotz
tschubotz / gnosis_safe_developer_resources.md
Last active January 15, 2021 16:11
Gnosis Safe - Developer Resources and links
@kamescg
kamescg / .sol
Last active December 17, 2020 03:52
Encode Transaction and called MakerDAO DsProxyActions Contract
/* ------------------------ */
// Call Vault Manager (DsProxyActions.sol)
/* ------------------------ */
function callVaultManager (bytes memory _data) public payable {
IDSProxy proxy = IDSProxy(dss_proxy);
proxy.execute.value(msg.value)(vault_manager, _data);
}
function callVaultManager (uint256 _amount, bytes memory _data) public {
IDSProxy proxy = IDSProxy(dss_proxy);
@ajb413
ajb413 / comp_earned.md
Last active July 27, 2023 15:19
How do I retrieve the "COMP earned" value from the Compound protocol? Get the amount of accrued COMP token for an address using the Ethereum blockchain.

How do I retrieve the "COMP earned" value?

With a Smart Contract or JSON RPC

Get the value of COMP earned for an address that uses the Compound protocol. This can be done using the Lens contract with JSON RPC or another Smart Contract. If you do an eth_call with JSON RPC, it is free (no gas costs).

  1. Use the getCompBalanceMetadataExt method in the Lens contract https://etherscan.io/address/0xdCbDb7306c6Ff46f77B349188dC18cEd9DF30299#code
  2. Lens address is posted here https://github.com/compound-finance/compound-protocol/blob/master/networks/mainnet.json#L31
  3. Here is the definition https://github.com/compound-finance/compound-protocol/blob/master/contracts/Lens/CompoundLens.sol#L453
@spalladino
spalladino / falsehoods-that-ethereum-programmers-believe.md
Last active December 31, 2024 13:29
Falsehoods that Ethereum programmers believe

Falsehoods that Ethereum programmers believe

I recently stumbled upon Falsehoods programmers believe about time zones, which got a good laugh out of me. It reminded me of other great lists of falsehoods, such as about names or time, and made me look for an equivalent for Ethereum. Having found none, here is my humble contribution to this set.

About Gas

Calling estimateGas will return the gas required by my transaction

Calling estimateGas will return the gas that your transaction would require if it were mined now. The current state of the chain may be very different to the state in which your tx will get mined. So when your tx i

@emo-eth
emo-eth / chain_funcs.sh
Last active June 22, 2023 14:43
Helper functions for interacting with chains and Foundry tests. Source from .zshrc etc
###########
# Imports #
###########
# the RPCs file should include RPC URLs and Etherscan API Keys for relevant networks
# (in a separate file so they don't get committed)
source "$(dirname "$0")/rpcs.sh"
# any useful addresses for various networks for easy reference
source "$(dirname "$0")/addresses.sh"
# any useful functions and definitions for interacting with Seaport