HELGO Contracts
This describes the various contracts used in the HELGO ecosystem.
Contract Addresses
- Helgo Contract Address:
0x0567CA0dE35606E9C260CC2358404B11DE21DB44
- Initialization Parameters:
hexAddr
:0x2b591e99afe9f32eaa6214f7b7629768c40eeb39
(HEX token contract)routerAddr
:0x165c3410fc91ef562c50559f7d2289febed552d9
(PulseX router)factoryAddr
:0xc9cab624882418d8be742b570825a8d5eb8f89da
(Helfactory contract)
- Deployment Context: Launched on PulseChain with a total supply of 55,557,777,369 HELGO tokens minted to the Helgo contract, a figure chosen for symbolic and community significance.
- Helgas:
0xab7834356ad011f9a221446eb3ab01942ce1b9b7
- Hellp:
0x16c0c6b772534073bd58c0a032b9bac7bcd169a8
- Heldao:
0x1fd1bb3afcb6223c7a9398ffcef24f9077c749b5
HELGO Contract
Purpose
The Helgo contract is the core of the ecosystem, managing the issuance, distribution, and ecosystem setup of HELGO (ERC-20), and initializing HELGAS and HELLP farming pools.
Key Features
- Token Initialization: Mints the full supply of HELGO to itself for controlled distribution.
- Launch Phases: Facilitates a pre-launch deposit period and post-launch claiming of HELGO and HELLP.
- Liquidity Setup: Pairs HELGO with HEX for PulseX liquidity pools, creating HELLP (ERC-20) tokens.
- Locking: Integrates with Heldao for HELGO token locking.
- Emissions Funding: Allocates HELGO to Helgas (for HELGAS emissions) and HELLP to Hellp.
Detailed Mechanics
- Minting: Mints 55,557,777,369 HELGO tokens (ERC-20) upon deployment, held until distributed via claims or emissions.
- Launch Period: Users deposit HEX (or Pulse, swapped for HEX) over a predefined period (e.g., 2-4 weeks), tracked in a mapping (e.g.,
mapping(address => uint256) deposits
). - Distribution Formula: Post-launch, HELGO is distributed proportionally to HEX deposits (e.g.,
userShare = userDeposit / totalDeposits * availableHELGO
), with HELLP tokens minted for liquidity contributors. - Liquidity Pairing: Deposits HELGO and HEX into a PulseX HELGO/HEX pair, issuing HELLP tokens.
Methods
- ERC-20 Standard Methods (HELGO):
transfer(address to, uint256 amount)
: Transfers HELGO.approve(address spender, uint256 amount)
: Approves HELGO transfer.transferFrom(address from, address to, uint256 amount)
: Transfers HELGO if approved.totalSupply()
: Returns 55,557,777,369 (adjusted for burns).balanceOf(address account)
: Returns HELGO balance.allowance(address owner, address spender)
: Returns approved HELGO amount.
- Custom Methods:
deposit(uint256 amount)
: Transfers HEX to Helgo during launch, updates balances.transform()
: Accepts Pulse, swaps it for HEX via PulseX, then deposits.claim()
: Distributes HELGO and HELLP post-launch based on deposit shares.launch()
: Finalizes launch, initializes liquidity pools, allocates locked tokens.lock(uint256 amount, uint64 start, uint64 duration)
: Transfers HELGO to Heldao.burn(uint256 amount)
: Burns HELGO, reducing supply.fundHELGAS(uint256 amount)
: Sends HELGO to Helgas for emissions and HELGAS issuance.fundHELLP(uint256 amount)
: Sends HELLP to Hellp for emissions.
Interactions
- HEX: Receives deposits, pairs with HELGO.
- PulseX Router/Factory: Facilitates swaps and liquidity pools, issuing HELLP.
- Heldao: Locks HELGO.
- Helgas: Funds HELGO for HELGAS emissions.
- Hellp: Funds HELLP for emissions.
HELDAO Contract
Purpose
Manages token locking and voting for governance using HELGO (ERC-20).
The Heldao contract empowers the HELGO ecosystem with robust governance, bolstered by the commitment of its 37 founders, each holding voting power through dedicated vaults locked for 5,555 days. This long-term lockup demonstrates their collective dedication to the project's success, ensuring stability and fostering trust within the community. By securing these votes in vaults, the founders can responsibly manage emissions and safeguard the DAO against potential abuse, aligning their incentives with the ecosystem's growth and creating a positive foundation for decentralized decision-making that benefits all participants.
Key Features
- Locking: Secures HELGO for specified durations.
- Vaults: Manages vaults for DAO participants.
- Voting: Ties voting power to locked HELGO and duration.
- Price Tracking: Monitors HEX price for conditional votes.
Voting Mechanics
- Voting Power:
lockedAmount * lockDurationDays
(e.g., 100 HELGO locked for 365 days = 36,500 votes). - Price History: Tracks HEX price daily over at least 3 days (
VOTE_MIN_PRICE_DAYS
) in a mapping (e.g.,mapping(uint256 => uint256) priceHistory
). - Proposal Execution: Executes the winning proposal if conditions are met (e.g., HEX price thresholds).
Methods
initVault(address addr, uint64 start, uint64 duration)
: Locks HELGO fromstart
forduration
days.castVote(uint proposal, uint256 _votes)
: Allocates votes to a proposal ID (1-6).balanceOf(address addr)
: Total locked HELGO in vault.locked(address addr)
: Unvested locked amount.vested(address addr)
: Releasable amount after duration.votes(address addr)
: Current voting power.priceHEX()
: Fetches HEX price via PulseX router.
Interactions
- Helgo: Receives locked HELGO tokens (ERC-20).
- HEX/PulseX: Tracks price and executes swaps.
DAO Voting Proposals
Voting Process
- Power:
lockedHELGO * lockDays
(e.g., 1000 HELGO for 90 days = 90,000 votes). - Period: Adjustable from 3 hours to 4 weeks.
- Execution: Winning vote triggers action if conditions met.
Proposals
- Idiot T Man
- ID:
1
- Description: 'Use 0.69% of HEX to buy HELGO'
- Action: Swaps 0.69% of HEX for HELGO.
- ID:
- Shut Up Idiot Man
- ID:
2
- Description: 'Use 0.69% of HELGO to buy HEX'
- Action: Swaps 0.69% of HELGO for HEX.
- ID:
- I Am Helgo
- ID:
3
- Description: 'Uses 3.69% of HEX to buy HELGO (votable when HEX near ATH)'
- Condition: HEX near ATH.
- ID:
- Please Everybody Remember to Buy Hex
- ID:
4
- Description: 'Uses 3.69% of HELGO to buy HEX (votable when HEX at 3 month low)'
- Condition: HEX at 3-month low.
- ID:
- Double Period
- ID:
5
- Description: 'Doubles the length of the vote period'
- Action: Max 4 weeks.
- ID:
- Half Period
- ID:
6
- Description: 'Halves the length of the vote period'
- Action: Min 3 hours.
- ID:
Key Constants
MEME_SMALL_PERC
: 0.69%MEME_LARGE_PERC
: 3.69%VOTE_MIN_PRICE_DAYS
: 3- Voting Limits: 3 hours to 4 weeks
- Helgas Emission Rate: 6.69% (HELGO distributed, HELGAS as shares)
- Hellp Emission Rate: 16.9% (HELLP distributed)
- Deposit/Withdrawal Fees: 0.69%
- Ramp Reward: 0.1% of emissions
HELGAS Contract
Purpose
Manages the farming pool for HELGO (ERC-20), issuing HELGAS (ERC-20) tokens to represent farmers’ shares of the staked HELGO pool, and distributes HELGO emissions as rewards.
Key Features
- Emissions: Releases HELGO at 6.69% annually to HELGAS holders.
- Pool Shares: Issues HELGAS tokens to represent farmers’ ownership of the HELGO pool.
- Fee Mechanism: Applies 0.69% deposit and withdrawal fees, with deposit fees burned (HELGO).
Emission Mechanics
- Rate: Distributes 6.69% of funded HELGO annually (e.g., 1 million HELGO funded yields 66,900 HELGO/year, or ~183/day initially).
- Fee Structure:
- Deposit: 0.69% of deposited HELGO burned (e.g., 1000 HELGO deposit burns 6.9 HELGO, 993.1 HELGO staked, HELGAS minted proportionally).
- Withdrawal: 0.69% fee deducted from withdrawn HELGO (e.g., 1000 HELGO withdrawal yields 993.1 HELGO, HELGAS burned).
- Reward Calculation: Farmers receive a share of the daily HELGO emissions proportional to their HELGAS balance relative to the total HELGAS supply (e.g.,
reward = (userHELGAS / totalHELGAS) * dailyEmission
), adjusted daily viaemitting
. - Ramp Function:
ramp()
triggers HELGO emission payouts to HELGAS holders and rewards the caller with 0.1% of the distributed HELGO (e.g., 183 HELGO/day emitted, caller gets 0.183 HELGO). - Variable Yield: Yield adjusts dynamically based on the number of farmers (HELGAS holders), offering higher returns when participation is lower. As HELGO’s price rises and farmers withdraw, reducing total HELGAS, yields increase for remaining holders. More participants dilute the yield.
- Daily Reduction: HELGO emissions decrease daily, increasing scarcity and reducing inflation.
Emission Struct
The Emission
struct is a conceptual tool used to calculate emission events within the Helgas contract, logged via the Emission
event.
- Definition:solidity
struct Emission { uint256 timestamp; // The timestamp of the emission event (in seconds) uint256 amount; // The amount of HELGO emitted in this cycle int128 yield; // The yield rate applied to this emission (signed, fixed-point) }
- Purpose: Represents the structure of data calculated by
emitting
and emitted as theEmission
event (event Emission(uint256 timestamp, uint256 amount, int128 yield)
). It is not stored on-chain but used temporarily to log emission details off-chain. - Usage: Facilitates tracking of daily HELGO emissions via events for transparency and reward distribution.
Emitting Method
The emitting
method calculates the daily HELGO emission for the Helgas pool, emitting it as an Emission
event.
- Signature:
function emitting() internal returns (uint256)
- Functionality:
- Input: Operates on contract state (e.g., total staked HELGO, elapsed time).
- Logic:
- Checks if a day has passed (e.g.,
block.timestamp >= lastEmissionTimestamp + 1 days
). - Calculates base daily emission:
baseAmount = totalStakedHELGO * 0.0669 / 365
. - Computes yield:
yield = int128((0.0669 / 365) * 10^18 / numFarmers)
, reflecting variable yield. - Emits event:
emit Emission(block.timestamp, adjustedAmount, calculatedYield)
. - Updates
lastEmissionTimestamp
toblock.timestamp
.
- Checks if a day has passed (e.g.,
- Output: Returns the
amount
of HELGO emitted, distributed to HELGAS holders viaramp()
.
- Purpose: Calculates and logs daily HELGO emissions as an
Emission
event, enabling proportional reward distribution to HELGAS holders. - Called By:
ramp()
to update emissions before distribution.
Methods
- ERC-20 Standard Methods (HELGAS):
transfer(address to, uint256 amount)
: Transfers HELGAS.approve(address spender, uint256 amount)
: Approves HELGAS transfer.transferFrom(address from, address to, uint256 amount)
: Transfers HELGAS if approved.totalSupply()
: Total HELGAS issued (proportional to staked HELGO).balanceOf(address account)
: HELGAS balance.allowance(address owner, address spender)
: Approved HELGAS amount.
- Custom Methods:
deposit(uint256 amount)
: Stakes HELGO (viatransferFrom
), burns 0.69%, mints HELGAS.withdraw(uint256 amount)
: Burns HELGAS, withdraws HELGO, deducts 0.69% fee (viatransfer
).fund(uint256 amount)
: Receives HELGO from Helgo (viatransfer
).ramp()
: Distributes HELGO emissions to HELGAS holders, pays caller 0.1% (viatransfer
), callsemitting
.emitting()
: Returns next HELGO emission rewards.emissions()
: Total distributed HELGO (cumulative, may be tracked off-chain via events).
Interactions
- Helgo: Receives HELGO funds (ERC-20), burns deposit fees.
- HELGO: Managed as the staked asset, emitted as rewards.
HELLP Contract
Purpose
Manages the farming pool for HELGO/HEX LP tokens, issuing HELLP (ERC-20) tokens to represent farmers’ shares of the staked LP pool, and distributes HELLP emissions as rewards.
Key Features
- Emissions: Releases HELLP at 16.9% annually to HELLP holders.
- Pool Shares: Issues HELLP tokens to represent farmers’ ownership of the HELGO/HEX LP pool.
- Fees: Applies 0.69% deposit and withdrawal fees, with deposit fees used for HELGO buybacks.
- Buybacks: Enhances HELGO value using HELLP fees.
Buyback and Emission Mechanics
- Emission Rate: Distributes 16.9% of funded HELLP annually (e.g., 1 million HELLP yields 169,000/year, or ~463/day initially).
- Fee Structure:
- Deposit: 0.69% of staked HELLP used to buy HELGO via PulseX (e.g., 1000 HELLP deposit uses 6.9 HELLP for buyback, 993.1 HELLP staked, HELLP minted proportionally).
- Withdrawal: 0.69% fee deducted from withdrawn HELLP (e.g., 1000 HELLP withdrawal yields 993.1 HELLP, HELLP burned).
- Buyback Process: Deposit fees swapped for HELGO (ERC-20), then burned or redistributed to Helgas.
- Reward Calculation: Farmers receive a share of the daily HELLP emissions proportional to their HELLP balance relative to the total HELLP supply (e.g.,
reward = (userHELLP / totalHELLP) * dailyEmission
), adjusted daily viaemitting
. - Ramp Function:
ramp()
triggers HELLP emission payouts to HELLP holders and rewards the caller with 0.1% of the distributed HELLP (e.g., 463 HELLP/day emitted, caller gets 0.463 HELLP). - Variable Yield: Yield adjusts dynamically based on the number of farmers (HELLP holders), offering higher returns when participation drops. As farmers withdraw, reducing total HELLP, yields rise for remaining holders. Increased participation dilutes the yield.
- Daily Reduction: HELLP emissions decrease daily, enhancing scarcity and reducing inflation.
Emission Struct
The Emission
struct is a conceptual tool used to calculate emission events within the Hellp contract, logged via the Emission
event.
- Definition:solidity
struct Emission { uint256 timestamp; // The timestamp of the emission event (in seconds) uint256 amount; // The amount of HELLP emitted in this cycle int128 yield; // The yield rate applied to this emission (signed, fixed-point) }
- Purpose: Represents the structure of data calculated by
emitting
and emitted as theEmission
event (event Emission(uint256 timestamp, uint256 amount, int128 yield)
). It is not stored on-chain but used temporarily to log emission details off-chain. - Usage: Facilitates tracking of daily HELLP emissions via events for transparency and reward distribution.
Emitting Method
The emitting
method calculates the daily HELLP emission for the Hellp pool, emitting it as an Emission
event.
- Signature:
function emitting() internal returns (uint256)
- Functionality:
- Input: Operates on contract state (e.g., total staked HELLP, elapsed time).
- Logic:
- Checks if a day has passed (e.g.,
block.timestamp >= lastEmissionTimestamp + 1 days
). - Calculates base daily emission:
baseAmount = totalStakedHELLP * 0.169 / 365
. - Computes yield:
yield = int128((0.169 / 365) * 10^18 / numFarmers)
, reflecting variable yield. - Emits event:
emit Emission(block.timestamp, adjustedAmount, calculatedYield)
. - Updates
lastEmissionTimestamp
toblock.timestamp
.
- Checks if a day has passed (e.g.,
- Output: Returns the
amount
of HELLP emitted, distributed to HELLP holders viaramp()
.
- Purpose: Calculates and logs daily HELLP emissions as an
Emission
event, enabling proportional reward distribution to HELLP holders. - Called By:
ramp()
to update emissions before distribution.
Methods
- ERC-20 Standard Methods (HELLP):
transfer(address to, uint256 amount)
: Transfers HELLP.approve(address spender, uint256 amount)
: Approves HELLP transfer.transferFrom(address from, address to, uint256 amount)
: Transfers HELLP if approved.totalSupply()
: Total HELLP issued (proportional to staked LP tokens).balanceOf(address account)
: HELLP balance.allowance(address owner, address spender)
: Approved HELLP amount.
- Custom Methods:
deposit(uint256 amount)
: Stakes HELGO/HEX LP tokens (viatransferFrom
), uses 0.69% for HELGO buyback, mints HELLP.withdraw(uint256 amount)
: Burns HELLP, withdraws LP tokens, deducts 0.69% fee (viatransfer
).fund(uint256 amount)
: Receives HELLP from Helgo (viatransfer
).ramp()
: Distributes HELLP emissions to HELLP holders, pays caller 0.1% (viatransfer
), callsemitting
.emitting()
: Returns next HELLP emission rewards.emissions()
: Total distributed HELLP (cumulative, may be tracked off-chain via events).
Interactions
- Helgo: Funds HELLP (ERC-20), performs buybacks with HELGO (ERC-20).
- HEX/PulseX: Manages swaps and LP token interactions.
Helfactory Contract
Purpose
Factory for deploying Helgas and Hellp instances, initializing HELGAS and HELLP tokens.
Key Features
- Scalability: Enables multiple emission contracts with unique HELGAS and HELLP tokens.
Deployment Mechanics
- Parameters: Sets token addresses (HELGO for Helgas, HELGO/HEX LP for Hellp) and emission rates (6.69% for Helgas, 16.9% for Hellp).
- Ownership: Controlled by Helgo contract.
Methods
newHelgas(address helgo)
: Deploys Helgas with 6.69% HELGO emission rate, initializes HELGAS token.newHellp(address pair, address router, address token0, address token1)
: Deploys Hellp with 16.9% HELLP emission rate, initializes HELLP token.
Ecosystem lifecycle
Launch Phase
- Deposits: Users send HEX or Pulse (swapped to HEX) to Helgo over 2-4 weeks.
- Tracking: Contributions stored in
mapping(address => uint256) deposits
.
Post-Launch Operations
- Distribution: Claims issue HELGO/HELLP based on deposit shares.
- Liquidity: HELGO/HEX pair created on PulseX.
- Locking: Founder tokens locked in Heldao
- Emissions: Helgas (6.69%) and Hellp (16.9%) funded, with
ramp()
distributing rewards. - Scarcity: Rewards reduce every day. Making it harder to acquire HELGO with time.
Other Considerations
- Fee Management: Secure 0.69% fee and 0.1% ramp reward handling.
- Price Oracles: Uses reliable HEX price feeds.
- Token Approvals: Secure transfer permissions.