Проверенный контрактТочноеMIT
InstallmentRelease
Адрес0xbc76b5a4792ac75fc4b5080f6622605d370b2db2
- Баланс
0 ETH
- Транзакций
1
- Компилятор
solc 0.8.37
- Тот же код
Только этот контракт
Подробности
- Компилятор
- solc 0.8.37+commit.f401782d
- Язык
- solidity
- Версия EVM
- cancun
- Лицензия
- MIT
- Совпадение
- Точноекод создания: да, код в сети: да
- Проверен на Sourcify
- Создан в блоке
- 26 450 869
- Транзакция создания
- 0xc3f1b88dda…592e44d5cc
InstallmentRelease.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/// @notice Five fixed ETH installments forwarded atomically to the destination.
/// @dev Only the specified source address may call fundAndRelease.
contract InstallmentRelease {
address public constant destination = address(bytes20(hex"7a1dde2b82d6c4e864d537cf6e93f2cc7045cb38"));
address public constant reportedSource = address(bytes20(hex"59708733fbbf64378d9293ec56b977c011a08fd2"));
uint256 public constant firstFundingBlock = 26458502;
uint256 public constant lastFundingBlock = 26459401;
uint256 public totalReleased;
bool[5] public released;
bool private entered;
event PlanCreated(address indexed deployer, address indexed destination, address reportedSource, uint256 firstBlock, uint256 lastBlock, uint256 totalWei);
event InstallmentReleased(uint256 indexed installment, address indexed funder, address indexed destination, uint256 amountWei);
constructor() {
require(block.number < firstFundingBlock, "Funding window already started");
emit PlanCreated(msg.sender, destination, reportedSource, firstFundingBlock, lastFundingBlock, 5386.48 ether);
}
function installmentAmount(uint256 installment) public pure returns (uint256) {
require(installment < 5, "Unknown installment");
uint256[5] memory amounts = [uint256(1052.34 ether), 1106.18 ether, 1068.92 ether, 1089.57 ether, 1069.47 ether];
return amounts[installment];
}
/// @notice Call with installment 0..4 and its exact ETH amount within the inclusive funding block window.
/// @dev A failed recipient transfer reverts the funding and all state changes.
function fundAndRelease(uint256 installment) external payable {
require(msg.sender == reportedSource, "Unauthorized funding caller");
require(!entered, "Reentrant call");
require(block.number >= firstFundingBlock, "Funding window not open");
require(block.number <= lastFundingBlock, "Funding window closed");
uint256 amount = installmentAmount(installment);
require(!released[installment], "Already released");
require(msg.value == amount, "Incorrect funding amount");
entered = true;
released[installment] = true;
totalReleased += amount;
(bool success,) = payable(destination).call{value: amount}("");
require(success, "Destination transfer failed");
emit InstallmentReleased(installment, msg.sender, destination, amount);
entered = false;
}
}
Настройки компилятораПоказать
{
"evmVersion": "cancun"
}Исходный код и метаданные: Sourcify.
Исходный код принадлежит авторам контракта.