Skip to content

Commit

Permalink
fix: do not self-refer
Browse files Browse the repository at this point in the history
  • Loading branch information
ratik committed Jun 14, 2024
1 parent 5a3ac11 commit 545868e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mappings/mappingHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ export async function handleBondExecution(
`New Bond Execution at block ${msg.block.header.height.toString()}`
);
const referral = msg.msg.decodedMsg.msg.bond?.ref || "";

if (referral === msg.msg.decodedMsg.sender) {
logger.info('User cannot refer himself');
return;
}
const prevUserBond = await UserBond.get(msg.msg.decodedMsg.sender);
if (prevUserBond) {
logger.info('User %s already bonded');
Expand Down

0 comments on commit 545868e

Please sign in to comment.