npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@beandao/factorieth

v1.0.0

Published

Factorieth Smart Contract Integration Library

Downloads

5

Readme

Factori.eth

자주 사용되는 컨트랙트들을 작은 코드 크기로 배포할 수 있으며, 모든 배포된 컨트랙트가 공통된 코드베이스를 사용하기 때문에 전체 블록체인의 크기를 줄이는데 기여합니다.

Deployed

Mainnet

  • FactoryV1: 0x7906743465F43fe72Ced0986D62037920929dDC7
    • Price: 0.01 ETH
    • StandardERC20 key: 0xd84f5b1df9c4fd84edcba18d9eec1e0598f898a9d84025ffcd437e0b828fbbe5
    • MerkleDistributor key: 0x27b7cec299fe3e6f5913fa9a95be3169fde20709807359cbdd0a76849bcbe97d
    • VestingEscrow key: 0x8c5d5e4f2902234c981bd69bbfb6bf4cc9e4adbd704d340671dac44dcad3f0d8

Optimism

  • FactoryV1: 0x677ef2B01493e235fE2271AFcd01d7e22975Ce5b
    • Price: 0.001 ETH
    • StandardERC20 key: 0x7f24bd37566ed112a5fd314170e33c8e40c7d269e0edb6191c4bdbb2abe55315
    • L2StandardERC20 key: 0x2aa4348ea67f2b4fb341743986c38b48067fd815ea436e08a922b298733b5442
    • MerkleDistributor key: 0xfe6535b0627e8568ef1eafa214039fd7c90acacd1dc934553a060683d6180097
    • VestingEscrow key: 0x1e568a0b6523217334b8ae190af264b89824c9b23402a2ae782fb93bf6e99ad9

Goerli

  • FactoryV1: 0x131bC833b5857A74466ce61b0A2EE4CFc2436002
    • Price: 0.01 ETH
    • StandardERC20 key: 0x39d750b6e6944bb4361c7379b5f0fa20f77b99adc94192761c67ffd0e3fb04e6
    • MerkleDistributor key: 0x1df4fa81b7029485e75e8567a980cbb02ef58e65fda79384f7df2a0b6f5e9a3a
    • VestingEscrow key: 0x4e2407a6af55c287bda11462e5e0810cdf2cf83c38200c3f0e9cccebe5e96106

Kovan

  • FactoryV1: 0x43ccFa6D2E5cB209a4764Ad1DA46e5B5B32C644D
    • Price: 0.01 ETH
    • StandardERC20 key: 0x9826236a1bc4fc40f2cca879bc5ed99015ca0427eba794e5e6445427acd5055d
    • MerkleDistributor key: 0x5d29e9fad9171dbbd99199b154f79a94c1583ceb907cb2ce6f89b701df69c647
    • VestingEscrow key: 0xc4bfab919fc3beb03ab61980fca95cb2c49aa95c1762e6149adcd3b004266285

Optimism Testnet

  • FactoryV1: 0xd5ac3B857177A0081e2BcF4CAd803e4FE2B5F366
    • Price: 0.001 ETH
    • StandardERC20 key: 0x6108e99ff7450dcaa72e5352300c431df06d6a29f7d4ef425ddd124775b2138c
    • L2StandardERC20 key: 0x7086e604b2f6abf7cd6acd06ac7185589800477c125dccfec0ea104159c12786
    • MerkleDistributor key: 0xe8d3e74813db60888defcb8ab86ac511fce6481052109d6e003ceb2388b6cce8
    • VestingEscrow key: 0xd460dccff7ffce909ad9de70f40f3f2e48e0d4a48374991783a70fbcb5394df3

FactoryV1을 통해서 토큰을 배포하기 위해서는 다음과 같은 작업을 필요로 합니다.

const ABI = [
    'function initialize(bytes calldata data)',
    'function mintTo(address to, uint256 value)',
    'function transferOwnership(address newOwner)',
];
const interfaces = new ethers.utils.Interface(ABI);

// 토큰 컨트랙트의 이름
const tokenName = 'TESTToken';
// 토큰 컨트랙트의 심볼
const tokenSymbol = 'TT';
// 토큰의 소수점 자리
const tokenDecimals = ethers.BigNumber.from('18');
// 소수점 자리를 포함하여 토큰을 처음 배포할 숫자는 다음이 됩니다. 100.000000000000000000
const initialToken = ethers.BigNumber.from('100000000000000000000');

// 토큰을 배포하면서 초기화 할 때 필요한 데이터를 직렬화 합니다.
const initdata = interfaces.encodeFunctionData('initialize', [
    ethers.utils.defaultAbiCoder.encode(['string', 'string', 'uint8'], [tokenName, tokenSymbol, tokenDecimals]),
]);

// 토큰 컨트랙트를 배포할 때 토큰을 수령하도록 합니다.
// 해당 작업으로, 토큰 수량이 결정되고 총 공급량이 업데이트 됩니다.
const mintCallData = interfaces.encodeFunctionData('mintTo', [
    '토큰 수령인의 이더리움 주소',
    initialToken,
]);

// 배포된 토큰 컨트랙트의 소유권 이전(이 작업이 없다면, 토큰 컨트랙트의 소유권은 factory가 가지고 있습니다)
// 토큰 컨트랙트의 소유권이 있다면 추후에 토큰을 생성하거나 소각할 수 있습니다.
const ownerCallData = interfaces.encodeFunctionData('transferOwnership', [
    '토큰 컨트랙트의 소유권을 가질 이더리움 주소',
]);

const Factory = await ethers.getContractAt(FACTORY_ABI, FACTORY_ADDRESS);

// factory에서 토큰 컨트랙트의 템플릿 키를 넣고, 초기화 데이터, 그리고 각각 필요한 호출을 배열형태로 넣어줍니다.
await Factory['deploy(bool,bytes32,bytes,bytes[])'](
    false,
    TOKEN_KEY,
    initdata,
    [mintCallData, ownerCallData],
    { value: ethers.utils.parseEther('0.01') },
);
// tx가 완료되면 토큰 컨트랙트가 배포되어 토큰을 발행하고 Factory가 가지고 있던 오너십을 넘기게 됩니다.