Address Contract Verified
Address
0x2CC861aA34C7311CD18fCd145f7f7E04dF76F4a3
Balance
0 ETH
Nonce
1
Code Size
1560 bytes
Creator
0x42d8C5F1...396f at tx 0x88a9a74e...27b268
Indexed Transactions
Index loading...
Contract Bytecode
1560 bytes
0x6080604052600436106100745760003560e01c806386491dd91161004e57806386491dd91461010d578063c2459ca814610122578063c36e60a914610142578063d294f0931461015757600080fd5b80633a6a4d2e146100805780635b2ef37e146100975780637402a85d146100d457600080fd5b3661007b57005b600080fd5b34801561008c57600080fd5b5061009561016c565b005b3480156100a357600080fd5b506002546100b7906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156100e057600080fd5b506002546100f890600160a01b900463ffffffff1681565b60405163ffffffff90911681526020016100cb565b34801561011957600080fd5b50610095610411565b34801561012e57600080fd5b506001546100b7906001600160a01b031681565b34801561014e57600080fd5b5061009561048b565b34801561016357600080fd5b506100956104e3565b61017461053b565b600254600090620151809061019690600160a01b900463ffffffff164261057b565b6101a09190610594565b6101ab9060016105b6565b6001546040805163d294f09360e01b8152905192935047926001600160a01b039092169163d294f0939160048082019260009290919082900301818387803b1580156101f657600080fd5b505af115801561020a573d6000803e3d6000fd5b50505050600260009054906101000a90046001600160a01b03166001600160a01b03166386491dd96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561025e57600080fd5b505af1158015610272573d6000803e3d6000fd5b505060025460405163a84dd99360e01b815260086004820152600093506001600160a01b03909116915063a84dd99390602401602060405180830381865afa1580156102c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e691906105c9565b9050808363ffffffff161061035e57600260009054906101000a90046001600160a01b03166001600160a01b031663c36e60a96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561034557600080fd5b505af1158015610359573d6000803e3d6000fd5b505050505b600061036a834761057b565b604051909150600090339083908381818185875af1925050503d80600081146103af576040519150601f19603f3d011682016040523d82523d6000602084013e6103b4565b606091505b50509050806104005760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b604482015260640160405180910390fd5b505050505061040f6001600055565b565b61041961053b565b600260009054906101000a90046001600160a01b03166001600160a01b03166386491dd96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561046957600080fd5b505af115801561047d573d6000803e3d6000fd5b5050505061040f6001600055565b61049361053b565b600260009054906101000a90046001600160a01b03166001600160a01b031663c36e60a96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561046957600080fd5b6104eb61053b565b600160009054906101000a90046001600160a01b03166001600160a01b031663d294f0936040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561046957600080fd5b60026000540361055e57604051633ee5aeb560e01b815260040160405180910390fd5b6002600055565b634e487b7160e01b600052601160045260246000fd5b8181038181111561058e5761058e610565565b92915050565b6000826105b157634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561058e5761058e610565565b6000602082840312156105db57600080fd5b505191905056fea2646970667358221220eb75df31752b7dc29c9543838ce31f66cb8929944378e93e29726143e2a4188b64736f6c63430008180033
Verified Source Code Full Match
Compiler: v0.8.24+commit.e11b9ed9
EVM: paris
Optimization: Yes (200 runs)
DistributionWrapper.sol 54 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "./interfaces/IBlazeAuction.sol";
import "./interfaces/IBlazeStaking.sol";
contract DistributionWrapper is ReentrancyGuard {
IBlazeAuction public blazeAuction;
IBlazeStaking public blazeStaking;
uint32 public stakingStartTimestamp;
constructor(address _auction, address _staking) {
require(_auction != address(0), "Invalid auction Addresses");
require(_staking!= address(0), "Invalid stakingAddresses");
blazeAuction = IBlazeAuction(_auction);
blazeStaking = IBlazeStaking(_staking);
stakingStartTimestamp = blazeStaking._deploymentTimeStamp();
}
receive() external payable {}
function distributeFunds() external nonReentrant {
uint32 currentDay = uint32(((block.timestamp - stakingStartTimestamp) / 1 days) + 1);
uint256 beforeEthBalance = address(this).balance;
blazeAuction.claimFees();
blazeStaking.setFeeRewardsForAllCycle();
uint256 next8Day = blazeStaking.getNextCycleDistributionDay(8);
if(currentDay >= next8Day) {
blazeStaking.distributeFeeRewardsForAll();
}
uint256 incentive = address(this).balance - beforeEthBalance;
(bool sent, ) = payable(msg.sender).call{value: incentive}("");
require(sent, "Failed to send Ether");
}
function claimFees() external nonReentrant {
blazeAuction.claimFees();
}
function setFeeRewardsForAllCycle() external nonReentrant {
blazeStaking.setFeeRewardsForAllCycle();
}
function distributeFeeRewardsForAll() external nonReentrant {
blazeStaking.distributeFeeRewardsForAll();
}
}
IBlazeAuction.sol 8 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.24;
interface IBlazeAuction {
function mintBlazeTokensForLP() external;
function claimFees() external;
}
IBlazeStaking.sol 14 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.24;
interface IBlazeStaking {
function setFeeRewardsForAllCycle() external;
function distributeFeeRewardsForAll() external;
function _deploymentTimeStamp() external view returns (uint32);
function getNextCycleDistributionDay(uint16) external view returns (uint256);
function getUser2888BlazeToken(address user, uint256 cycle) external view returns (uint256 blazeTokenStaked);
}
ReentrancyGuard.sol 84 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
Read Contract
blazeAuction 0xc2459ca8 → address
blazeStaking 0x5b2ef37e → address
stakingStartTimestamp 0x7402a85d → uint32
Write Contract 4 functions
These functions modify contract state and require a wallet transaction to execute.
claimFees 0xd294f093
No parameters
distributeFeeRewardsForAll 0xc36e60a9
No parameters
distributeFunds 0x3a6a4d2e
No parameters
setFeeRewardsForAllCycle 0x86491dd9
No parameters
Recent Transactions
Transaction index is loading. Only unfinalized transactions are shown while the index starts up.