DeFi pledge loan mining system development (plan)

DeFi is a more open financial service platform with no trust center, no asset custody, and a programmable infrastructure.
1. The centralized platform requires KYC and user authentication. But DeFi interacts with the account itself and does not need to be bound to the identity itself.
2. In a centralized platform, customers' assets are hosted on the platform. If the platform misappropriates customer assets, users will not know. However, under the DeFi agreement, the user's assets are managed through smart contracts instead of platform custody, and the assets are protected by their own private keys.
3. For centralized platforms, the platform is obliged to review users' transaction qualifications, but it may also deliberately relax requirements during the review process. DeFi does not require permission to directly trade through the agreement. No matter which country you are from, whether you have money or not, to the agreement, you are an account that is a
product of the decentralized blockchain world through DeFi. With the further improvement of the infrastructure, the implementation of the public chain will get better and better, and it will be divided into four stages: the first step is to open the prologue of the public chain implementation by DeFi; the second step is to move the DeFi protocol to DAO; third The first step is to usher in the landing of Dapp after the basic performance reaches a certain level; the fourth step is the full landing of DAO. DeFi will not be a flash in the pan, it opens the first step in the implementation of public chains.

    function registration(address userAddress, address referrerAddress) private {
    require(msg.value == 0.05 ether, "registration cost 0.05");
    require(!isUserExists(userAddress), "user exists");
    require(isUserExists(referrerAddress), "referrer not exists");
    
    uint32 size;
    assembly {
        size := extcodesize(userAddress)
    }
    require(size == 0, "cannot be a contract");
    
    User memory user = User({
        id: lastUserId,
        referrer: referrerAddress,
        partnersCount: 0
    });
    
    users[userAddress] = user;
    idToAddress[lastUserId] = userAddress;
    
    users[userAddress].referrer = referrerAddress;
    
    users[userAddress].activeX3Levels[1] = true; 
    users[userAddress].activeX6Levels[1] = true;
    
    
    userIds[lastUserId] = userAddress;
    lastUserId++;
    
    users[referrerAddress].partnersCount++;

    address freeX3Referrer = findFreeX3Referrer(userAddress, 1);
    users[userAddress].x3Matrix[1].currentReferrer = freeX3Referrer;
    updateX3Referrer(userAddress, freeX3Referrer, 1);

    updateX6Referrer(userAddress, findFreeX6Referrer(userAddress, 1), 1);
    
    emit Registration(userAddress, referrerAddress, users[userAddress].id, users[referrerAddress].id);
}

function updateX3Referrer(address userAddress, address referrerAddress, uint8 level) private {
    users[referrerAddress].x3Matrix[level].referrals.push(userAddress);

    if (users[referrerAddress].x3Matrix[level].referrals.length < 3) {
        emit NewUserPlace(userAddress, referrerAddress, 1, level, uint8(users[referrerAddress].x3Matrix[level].referrals.length));
        return sendETHDividends(referrerAddress, userAddress, 1, level);
    }

Guess you like

Origin blog.csdn.net/T13242772558/article/details/109238912