File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,8 @@ contract DutchAuction {
227227 atStage (Stages.AuctionStarted)
228228 {
229229 require (receiver_address != 0x0 );
230+ require (receiver_address != address (this ));
231+ require (receiver_address != address (token));
230232 require (msg .value > 0 );
231233 assert (bids[receiver_address] + msg .value >= msg .value );
232234
Original file line number Diff line number Diff line change @@ -255,6 +255,13 @@ def test_auction_bid(
255255 token_multiplier = auction .call ().token_multiplier ()
256256
257257 auction .transact ({'from' : owner }).startAuction ()
258+ # Bids with the token contract address as receiver should fail
259+ with pytest .raises (tester .TransactionFailed ):
260+ auction .transact ({'from' : A , "value" : 100 }).bid (token .address )
261+
262+ # Bids with the auction contract address as receiver should fail
263+ with pytest .raises (tester .TransactionFailed ):
264+ auction .transact ({'from' : A , "value" : 100 }).bid (auction .address )
258265
259266 # End auction by bidding the needed amount
260267 missing_funds = auction .call ().missingFundsToEndAuction ()
You can’t perform that action at this time.
0 commit comments