Skip to content

Commit

Permalink
feat(auction): implement eoa-bidder (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 authored Oct 24, 2023
2 parents 98c17d9 + 9ecc86f commit 5a3867b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions script/20231024-upgrade-auction/20231024_UpgradeAuction.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import { ContractKey } from "foundry-deployment-kit/configs/ContractConfig.sol";
import { RNSDeploy } from "script/RNSDeploy.s.sol";

contract Migration__20231024_UpgradeAuction is RNSDeploy {
function run() public trySetUp {
_upgradeProxy(ContractKey.RNSAuction, EMPTY_ARGS);
}
}
2 changes: 1 addition & 1 deletion script/Debug.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contract Debug is RNSDeploy {

function debug(uint256 forkBlock, address from, address to, uint256 value, bytes calldata callData) external {
if (forkBlock != 0) {
vm.rollFork(forkBlock);
vm.rollFork(forkBlock);
}
vm.prank(from);
(bool success, bytes memory returnOrRevertData) = to.call{ value: value }(callData);
Expand Down
2 changes: 1 addition & 1 deletion src/RNSAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ contract RNSAuction is Initializable, AccessControlEnumerable, INSAuction {
if (msg.value < beatPrice) revert InsufficientAmount();
address payable bidder = payable(_msgSender());
// check whether the bidder can receive RON
if (!RONTransferHelper.send(bidder, 0)) revert BidderCannotReceiveRON();
if (bidder != tx.origin) revert ContractBidderIsForbidden();
address payable prvBidder = auction.bid.bidder;
uint256 prvPrice = auction.bid.price;

Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/INSAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface INSAuction {
error QueryIsNotInPeriod();
error InsufficientAmount();
error InvalidArrayLength();
error BidderCannotReceiveRON();
error ContractBidderIsForbidden();
error EventIsNotCreatedOrAlreadyStarted();

struct Bid {
Expand Down

0 comments on commit 5a3867b

Please sign in to comment.