Skip to content

Commit

Permalink
fix contract
Browse files Browse the repository at this point in the history
  • Loading branch information
youssefea committed Dec 17, 2023
1 parent b42612a commit 9c78e84
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions projects/gda-advertisement-auction/contracts/AdSpotContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ contract AdSpotContract is SuperAppBaseFlow {
// Getters
// ---------------------------------------------------------------------------------------------

/**
* @dev Returns the last update timestamp.
*/
function getLastUpdate() public view returns (uint) {
return lastUpdate;
}


/**
* @dev Returns the address of the pool.
*/
Expand Down Expand Up @@ -196,10 +188,9 @@ contract AdSpotContract is SuperAppBaseFlow {
if (highestBidder != address(0)) {
newCtx = acceptedToken.deleteFlowWithCtx(highestBidder, address(this), ctx);
uint128 halfShares = uint128(block.timestamp - lastUpdate) / 2;
if(pool.getUnits(owner)==1){
pool.updateMemberUnits(owner, halfShares + pool.getUnits(owner)-1);
}
else{
if (pool.getUnits(owner) == 1) {
pool.updateMemberUnits(owner, halfShares + pool.getUnits(owner) - 1);
} else {
pool.updateMemberUnits(owner, halfShares + pool.getUnits(owner));
}
pool.updateMemberUnits(highestBidder, halfShares + pool.getUnits(highestBidder));
Expand Down Expand Up @@ -240,7 +231,10 @@ contract AdSpotContract is SuperAppBaseFlow {
newCtx = ctx;
uint128 halfShares = uint128(block.timestamp - lastUpdate) / 2;
ISuperfluidPool(poolAddress).updateMemberUnits(owner, halfShares + pool.getUnits(owner));
ISuperfluidPool(poolAddress).updateMemberUnits(highestBidder,halfShares + pool.getUnits(highestBidder));
ISuperfluidPool(poolAddress).updateMemberUnits(
highestBidder,
halfShares + pool.getUnits(highestBidder)
);
newCtx = acceptedToken.distributeFlowWithCtx(address(this), pool, senderFlowRate, newCtx);
highestBidder = sender;
highestFlowRate = senderFlowRate;
Expand Down

0 comments on commit 9c78e84

Please sign in to comment.