This repository contains the smart contracts for the LB Hooks Rewarder.
The LBBaseHooks contract is the base contract for all hooks. It contains empty functions that can be overridden by the inheriting contracts to perform custom logic.
The LBHooksBaseRewarder contract is the base contract for all rewarders. It contains the logic for distributing rewards to users.
The LBHooksBaseParentRewarder contract is the base contract for all parent rewarders. It contains the logic to allow a secondary rewarder to distribute an additional reward to users.
The LBHooksBaseSimpleRewarder contract is the base contract for all rewarders that distribute rewards based on the rewardsPerSecond, lastUpdateTimestamp, and endTimestamp variables. It will distribute rewardPerSecond rewards per seconds if the lastUpdateTimestamp is smaller or equal to the current timestamp and the endTimestamp is greater or equal to the current timestamp.
The LBHooksSimpleRewarder contract is a simple rewarder that distributes rewards based on the rewardsPerSecond, lastUpdateTimestamp, and endTimestamp variables. As it is also a Parent Rewarder, it can distribute additional rewards to users if an extra rewarder is set.
The LBHooksMCRewarder contract is a rewarder that distributes rewards based on the amount of tokens he receives from a master chef contract. It will forward all the tokens received from the master chef to the users. As it is also a Parent Rewarder, it can distribute additional rewards to users if an extra rewarder is set.
The LBHooksExtraRewarder contract is a rewarder that distributes additional rewards to users based on the rewardsPerSecond, lastUpdateTimestamp, and endTimestamp variables. It will distribute rewardPerSecond rewards per seconds if the lastUpdateTimestamp is smaller or equal to the current timestamp and the endTimestamp is greater or equal to the current timestamp. It is expected to be used as a secondary rewarder by a parent rewarder.
Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
Foundry consists of:
- Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
- Chisel: Fast, utilitarian, and verbose solidity REPL.
$ forge build$ forge test$ forge fmt$ forge snapshot$ anvil$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>$ cast <subcommand>$ forge --help
$ anvil --help
$ cast --help