Skip to content

Commit

Permalink
update adSpot contract
Browse files Browse the repository at this point in the history
  • Loading branch information
youssefea committed Nov 16, 2023
1 parent 0f14f8d commit d5d15ac
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions projects/gda-advertisement-auction/contracts/AdSpotContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ contract Royalties is SuperAppBaseFlow {
bytes memory newCtx=ctx;
newCtx=acceptedToken.deleteFlowWithCtx(highestBidder,address(this), ctx);
uint128 halfShares=uint128(block.timestamp-lastUpdate)/2;
ISuperfluidPool(poolAddress).updateMemberUnits(owner,halfShares);
ISuperfluidPool(poolAddress).updateMemberUnits(highestBidder,halfShares);
pool.updateMemberUnits(owner,halfShares);
if (highestBidder!=address(0)){
ISuperfluidPool(poolAddress).updateMemberUnits(highestBidder,halfShares);
}
newCtx=gda.distributeFlow(acceptedToken, address(this),pool,senderFlowRate,newCtx);
highestBidder=sender;
highestFlowRate=senderFlowRate;
Expand Down Expand Up @@ -110,6 +112,11 @@ contract Royalties is SuperAppBaseFlow {
bytes calldata ctx
) internal override returns (bytes memory newCtx) {

require(sender==highestBidder, "You don't have an active stream");
bytes memory newCtx=ctx;

return newCtx;

}


Expand Down

0 comments on commit d5d15ac

Please sign in to comment.