I am writing smart contract for MLM referral system, I am facing issues in getting and paying grand referrals if they are exists. #5178
Unanswered
sardarahmedkhan505
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can someone helps me in writing this contract. I attached the stackoverflow questions here.
https://ethereum.stackexchange.com/q/148091/105528
here is code I have written, Please add 3 levels up referral mechanism or grand referral in the buymemberhsip function.
`// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import "hardhat/console.sol";
contract ReferralMlm {
struct User {
address payable inviterAddress; // who invited this user
address[] referredAddresses; // list of referred addresses
}
uint public memberShipPrice = 3 ether;
address payable owner = payable(0x0A098Eda01Ce92ff4A4CCb7A4fFFb5A43EBC70DC);
}
`
Beta Was this translation helpful? Give feedback.
All reactions