Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@beandao/factorieth

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beandao/factorieth - npm Package Compare versions

Comparing version 0.3.2 to 1.0.0

build/contracts/IL2StandardERC20.json

185

build/contracts/IFactory.json

@@ -42,11 +42,24 @@ {

{
"indexed": true,
"internalType": "bytes32",
"name": "key",
"type": "bytes32"
"indexed": false,
"internalType": "uint256",
"name": "prevFee",
"type": "uint256"
},
{
"indexed": true,
"indexed": false,
"internalType": "uint256",
"name": "fee",
"type": "uint256"
}
],
"name": "FeeChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "template",
"name": "prevFeeTo",
"type": "address"

@@ -56,8 +69,8 @@ },

"indexed": false,
"internalType": "uint256",
"name": "price",
"type": "uint256"
"internalType": "address",
"name": "feeTo",
"type": "address"
}
],
"name": "NewTemplate",
"name": "FeeToChanged",
"type": "event"

@@ -75,3 +88,3 @@ },

{
"indexed": true,
"indexed": false,
"internalType": "address",

@@ -82,12 +95,25 @@ "name": "template",

{
"indexed": true,
"indexed": false,
"internalType": "address",
"name": "owner",
"name": "beacon",
"type": "address"
}
],
"name": "NewTemplate",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "key",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "uint256",
"name": "price",
"type": "uint256"
"internalType": "address",
"name": "template",
"type": "address"
}

@@ -104,22 +130,32 @@ ],

"type": "address"
},
}
],
"name": "addTemplate",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "ownerAddr",
"type": "address"
},
{
"internalType": "uint256",
"name": "price",
"name": "newFee",
"type": "uint256"
}
],
"name": "addBeacon",
"outputs": [
"name": "changeFee",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "beaconAddr",
"internalType": "address payable",
"name": "newFeeTo",
"type": "address"
}
],
"name": "changeFeeTo",
"outputs": [],
"stateMutability": "nonpayable",

@@ -136,13 +172,32 @@ "type": "function"

{
"internalType": "bytes",
"name": "initializationCallData",
"type": "bytes"
},
{
"internalType": "bytes[]",
"name": "calls",
"type": "bytes[]"
}
],
"name": "clone",
"outputs": [
{
"internalType": "address",
"name": "ownerAddr",
"name": "deployed",
"type": "address"
},
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "price",
"type": "uint256"
"internalType": "address",
"name": "tokenAddr",
"type": "address"
}
],
"name": "addTemplate",
"name": "collect",
"outputs": [],

@@ -155,2 +210,7 @@ "stateMutability": "nonpayable",

{
"internalType": "bool",
"name": "isBeacon",
"type": "bool"
},
{
"internalType": "bytes32",

@@ -166,3 +226,3 @@ "name": "templateId",

],
"name": "calculateDeployableAddress",
"name": "compute",
"outputs": [

@@ -181,2 +241,26 @@ {

{
"internalType": "address",
"name": "templateAddr",
"type": "address"
},
{
"internalType": "bytes",
"name": "initializationCallData",
"type": "bytes"
}
],
"name": "computeClone",
"outputs": [
{
"internalType": "address",
"name": "deployable",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",

@@ -187,2 +271,7 @@ "name": "seed",

{
"internalType": "bool",
"name": "isBeacon",
"type": "bool"
},
{
"internalType": "bytes32",

@@ -198,3 +287,3 @@ "name": "templateId",

],
"name": "calculateDeployableAddress",
"name": "computeWithSeed",
"outputs": [

@@ -213,2 +302,7 @@ {

{
"internalType": "bool",
"name": "isBeacon",
"type": "bool"
},
{
"internalType": "bytes32",

@@ -248,2 +342,7 @@ "name": "templateId",

{
"internalType": "bool",
"name": "isBeacon",
"type": "bool"
},
{
"internalType": "bytes32",

@@ -264,3 +363,3 @@ "name": "templateId",

],
"name": "deploy",
"name": "deployWithSeed",
"outputs": [

@@ -277,9 +376,3 @@ {

{
"inputs": [
{
"internalType": "bytes32",
"name": "templateId",
"type": "bytes32"
}
],
"inputs": [],
"name": "getPrice",

@@ -317,5 +410,5 @@ "outputs": [

{
"internalType": "bytes",
"name": "updateCode",
"type": "bytes"
"internalType": "address",
"name": "templateAddr",
"type": "address"
}

@@ -322,0 +415,0 @@ ],

{
"name": "@beandao/factorieth",
"description": "Factorieth Smart Contract Integration Library",
"version": "0.3.2",
"version": "1.0.0",
"files": [

@@ -6,0 +6,0 @@ "**/*.sol",

# 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
* StandardToken: 0x6403f288483cA9DA7409515967577042070628FE
* Template key: 0x254a2c8cf5790bce7b67ebee0b9248872894f42c48f15178f58ed5fd9df1b244
* Beacon key: 0x4a11e43cfddd716c15df4ee2923729a06a73946b6910e2b2afaba3ac715a0ff1
* Allowlist: 0xdFa76fDF338B1d7518A83392ec3989Ed26DE3b1C
* FactoryV1: 0xd91b593eeeada81dc7f6a20e4d8140ef5adf598a
* 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을 통해서 토큰을 배포하기 위해서는 다음과 같은 작업을 필요로 합니다.

@@ -18,3 +48,3 @@

const ABI = [
'function initialize(string memory contractVersion, string memory tokenName, string memory tokenSymbol, uint8 tokenDecimals)',
'function initialize(bytes calldata data)',
'function mintTo(address to, uint256 value)',

@@ -25,4 +55,2 @@ 'function transferOwnership(address newOwner)',

// 토큰 컨트랙트의 버전
const contractVersion = '1';
// 토큰 컨트랙트의 이름

@@ -38,3 +66,5 @@ const tokenName = 'TESTToken';

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

@@ -54,10 +84,13 @@ // 토큰 컨트랙트를 배포할 때 토큰을 수령하도록 합니다.

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

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc