EGL
  • 🦅The Ethereum Eagle Project (EGL)
  • Protocol Overview
    • Key Functionality
    • EGL Genesis
      • Genesis
      • Release Schedule
      • Balancer Deployment
    • Voting
      • Vote, Revote, Withdraw
      • Calculating desiredEgl
      • Voting Threshold
      • Rewards
      • Leaderboard
    • Mining Pool Reward
    • The DAO
      • EGL Signals
        • Allocations
    • Token Distribution
  • Developer Documentation
    • Architecture
    • Voting
      • Claiming EGLs
    • Withdrawing EGLs
    • Withdrawing Pool Tokens
    • Tally Votes
    • Setting the gasLimit and gasTarget
    • Claiming Miner Rewards
    • Internal Functions
  • Governance
  • Governance Model
  • User Guides
    • Genesis
    • Voting
      • Claim & Vote
      • Vote
      • Revote
    • Helpful Tips
  • Appendix
    • Formulas
    • Attributes
    • FAQs
      • Design
      • Genesis
      • Voting
      • Other
    • Audits
Powered by GitBook
On this page
  1. Developer Documentation

Claiming Miner Rewards

Public Functions

PreviousSetting the gasLimit and gasTargetNextInternal Functions

Last updated 3 years ago

Miners and mining pools are awarded EGL's when they produce a block with a gas limit that is within 1,000,000 of the desiredEgl. The reward amount is based on how close the block gas limit is to the desiredEgl value.

See for details

The reward must claimed by calling the sweepPoolRewards() and rewards for the block it is included in. The function can be called by anyone but the reward always goes to the block.coinbase address so the intention is for miners to include this transaction when they produce the block

1.sweepPoolRewards()

Function Signature

function sweepPoolRewards() external whenNotPaused

Validations

Validation Rule

Description

block.number > latestRewardSwept

If the reward for the block has already been claimed, it cannot be claimed again

Events Emitted

  • BlockRewardCalculated

  • Transfer (Conditional)

  • PoolRewardsSwept

Web3 Example

await eglVotingInstance.sweepPoolRewards({ from: "0x2be650ba..."})

Python Example

This example shows how to create, sign and send the raw transaction which calls sweepPoolRewards()

import sys
from web3 import Web3

if __name__ == "__main__":
    chainId = int(sys.argv[1])
    eglContractAddress = sys.argv[2]
    accountPvtKey = sys.argv[3]
    accountNonce = int(sys.argv[4])

    w3 = Web3(Web3.HTTPProvider())
    transaction = {
        "to": eglContractAddress, 
        "value": 0, 
        "gas": 78000, 
        "gasPrice": int(10*1e9), 
        "nonce": accountNonce, 
        "chainId": chainId, 
        "data": "0x112bbd1d"
    }
    signed_tx = w3.eth.account.sign_transaction(transaction, accountPvtKey)
    print(signed_tx.rawTransaction.hex())
    w3.eth.send_raw_transaction(signed_tx.rawTransaction)
Mining Pool Reward