setLockups

function setLockups( bytes _lockups );

Lockup ๋“ฑ๋ก Parameters

TypeValueDescription

bytes

_lockups

Lockup ์ •๋ณด๋“ค

โ€ป ABI Encode ํ˜•ํƒœ

Example

     // Lockup ์ •๋ณด ์ž…๋ ฅ (์•„๋ž˜ ์ˆœ์œผ๋กœ ๊ธฐ์ž…)

    address account;        // Lockup ๊ณ„์ • ์ฃผ์†Œ
    uint256 amount;         // Lockup ํ† ํฐ ๊ฐœ์ˆ˜
    uint256 duration;       // Lokcup ๊ธฐ๊ฐ„

    let lockupInfo = [
        [accounts[1].address, ethers.utils.parseEther("0.1"), ONE_MONTH*1],
        [accounts[1].address, ethers.utils.parseEther("0.1"), ONE_MONTH*2],
        [accounts[1].address, ethers.utils.parseEther("0.1"), ONE_MONTH*3],
    ]

    // Encode ํ˜•ํƒœ๋กœ ์น˜ํ™˜
    const abiCoder = ethers.utils.defaultAbiCoder;
    const encodeLockupInfo= abiCoder.encode(["tuple(address, uint256, uint256)[]"], [mintInfo]); 

    // exec
    await lockupContract.setLockups(encodeLockupInfo);

Last updated