Documentation Index
Fetch the complete documentation index at: https://docs.stable.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Stable은 USDT0를 가스 토큰으로 사용하므로, 체인과 상호작용하기 위해서는 지갑에 USDT0가 필요합니다. 먼저 Faucet을 사용하여 계정에 USDT0를 충전해야 합니다.
- https://faucet.stable.xyz 를 방문합니다
- ‘Get USDT0’ 버튼을 클릭하면 1 USDT0가 지갑으로 전송됩니다.
더 많은 USDT0가 필요한 경우, Ethereum Sepolia에서 Stable 테스트넷으로 Test USDT를 브리지할 수 있습니다.
-
https://sepolia.etherscan.io/token/0xc4DCC311c028e341fd8602D8eB89c5de94625927#writeContract 를 방문하여,
_mint 함수를 호출해 원하는 양의 Test Tether USD를 계정에 발행합니다.
-
Ethereum Sepolia의 LayerZero 브리지 컨트랙트로 다음 트랜잭션을 전송하여 Test USDT를 Stable 테스트넷으로 브리지합니다:
export function addrTo32Bytes(addr: string): Buffer {
const hex20 = ethers.utils.getAddress(addr).slice(2);
const padded = hex20.padStart(64, "0"); // 32 bytes ⇒ 64 hex
return Buffer.from(padded, "hex"); // length === 32
}
async function main() {
const [owner] = await ethers.getSigners();
const SEPOLIA_USDT0 = "0xc4DCC311c028e341fd8602D8eB89c5de94625927";
const SEPOLIA_USDT0_OAPP = "0xc099cD946d5efCC35A99D64E808c1430cEf08126"
const RECEIVER_EID = 40374;
const usdt0 = await ethers.getContractAt("ERC20", SEPOLIA_USDT0);
await usdt0.approve(SEPOLIA_USDT0_OAPP, ethers.utils.parseEther("1"));
const options = Options.newOptions().addExecutorLzReceiveOption(0, 0).toBytes();
const amount = ethers.utils.parseEther("1"); // Change this to your desired amount
const OFTAdapter = await ethers.getContractAt("OFTAdapter", SEPOLIA_USDT0_OAPP);
const sendParams = {
dstEid: RECEIVER_EID,
to: addrTo32Bytes(owner.address),
amountLD: amount,
minAmountLD: amount,
extraOptions: options,
composeMsg: Buffer.from(""),
oftCmd: Buffer.from(""),
};
const fee = await OFTAdapter.quoteSend(sendParams, false);
await OFTAdapter.send(
sendParams,
fee,
owner.address,
{
value: fee.nativeFee,
}
)
}