change some prop in IContractInitParam
MODIFY
src/interfaces/contract_init_param.ts
src/interfaces/contract_init_param.ts
export interface IContractInitParam {
- tokenAddress: string;
+ address: string;
isParent: boolean;
- tokenContractName: string;
+ name: string;
bridgeType?: string;
}
\ No newline at end of file

MODIFY
src/plasma/deposit_manager.ts
src/plasma/deposit_manager.ts
@@ -6,15 +6,15 @@ export class DepositManager extends BaseToken {
super(
{
isParent: true,
- tokenAddress: address,
- tokenContractName: "DepositManager"
+ address: address,
+ name: "DepositManager"
},
client
);
}
get address() {
- return this.contractParam.tokenAddress;
+ return this.contractParam.address;
}
}
\ No newline at end of file

MODIFY
src/plasma/erc20.ts
src/plasma/erc20.ts
@@ -21,8 +21,8 @@ export class ERC20 extends BaseToken {
) {
super({
isParent,
- tokenAddress,
- tokenContractName: 'ChildERC20'
+ address: tokenAddress,
+ name: 'ChildERC20'
}, client);
}
@@ -76,7 +76,7 @@ export class ERC20 extends BaseToken {
return this.contracts_.depositManager.getContract().then(contract => {
const method = contract.method(
"depositERC20ForUser",
- this.contractParam.tokenAddress,
+ this.contractParam.address,
userAddress,
Converter.toHex(amount)
);

MODIFY
src/plasma/erc20_predicate.ts
src/plasma/erc20_predicate.ts
@@ -6,8 +6,8 @@ export class Erc20Predicate extends BaseToken {
super(
{
isParent: true,
- tokenAddress: address,
- tokenContractName: "ERC20Predicate"
+ address: address,
+ name: "ERC20Predicate"
},
client
);

MODIFY
src/plasma/erc721.ts
src/plasma/erc721.ts
@@ -12,8 +12,8 @@ export class ERC721 extends BaseToken {
) {
super({
isParent,
- tokenAddress,
- tokenContractName: 'ChildERC721'
+ address: tokenAddress,
+ name: 'ChildERC721'
}, client);
}

MODIFY
src/plasma/ether.ts
src/plasma/ether.ts
@@ -18,8 +18,8 @@ export class Ether extends BaseToken {
super({
isParent: true,
- tokenAddress: null as any,
- tokenContractName: null as any,
+ address: null as any,
+ name: null as any,
bridgeType: null
}, client);
}

MODIFY
src/plasma/registry.ts
src/plasma/registry.ts
@@ -6,8 +6,8 @@ export class RegistryContract extends BaseToken {
super(
{
isParent: true,
- tokenAddress: address,
- tokenContractName: "Registry"
+ address: address,
+ name: "Registry"
},
client
);

MODIFY
src/plasma/withdraw_manager.ts
src/plasma/withdraw_manager.ts
@@ -8,8 +8,8 @@ export class WithdrawManager extends BaseToken {
super(
{
isParent: true,
- tokenAddress: address,
- tokenContractName: "WithdrawManager"
+ address: address,
+ name: "WithdrawManager"
},
client
);

MODIFY
src/pos/erc20.ts
src/pos/erc20.ts
@@ -18,8 +18,8 @@ export class ERC20 extends POSToken {
) {
super({
isParent,
- tokenAddress,
- tokenContractName: 'ChildERC20',
+ address: tokenAddress,
+ name: 'ChildERC20',
bridgeType: 'pos'
}, client, rootChainManager, exitManager);
}
@@ -76,7 +76,7 @@ export class ERC20 extends POSToken {
);
return this.rootChainManager.deposit(
userAddress,
- this.contractParam.tokenAddress,
+ this.contractParam.address,
amountInABI,
option
);

MODIFY
src/pos/erc721.ts
src/pos/erc721.ts
@@ -18,8 +18,8 @@ export class ERC721 extends POSToken {
) {
super({
isParent,
- tokenAddress,
- tokenContractName: 'ChildERC721',
+ address: tokenAddress,
+ name: 'ChildERC721',
bridgeType: 'pos'
}, client, rootChainManager, exitManager);
}
@@ -93,7 +93,7 @@ export class ERC721 extends POSToken {
);
return this.rootChainManager.deposit(
userAddress,
- this.contractParam.tokenAddress,
+ this.contractParam.address,
amountInABI,
option
);
@@ -108,7 +108,7 @@ export class ERC721 extends POSToken {
);
return this.rootChainManager.deposit(
userAddress,
- this.contractParam.tokenAddress,
+ this.contractParam.address,
amountInABI,
option
);

MODIFY
src/pos/pos_token.ts
src/pos/pos_token.ts
@@ -20,7 +20,7 @@ export class POSToken extends BaseToken {
if (this.predicateAddress) {
return promiseResolve(this.predicateAddress);
}
- const method = await this.rootChainManager.method("tokenToType", this.contractParam.tokenAddress);
+ const method = await this.rootChainManager.method("tokenToType", this.contractParam.address);
const tokenType = await method.read();
if (!tokenType) {
throw new Error('Invalid Token Type');

MODIFY
src/pos/root_chain.ts
src/pos/root_chain.ts
@@ -8,8 +8,8 @@ export class RootChain extends BaseToken {
constructor(client_: Web3SideChainClient, address: string) {
super({
- tokenAddress: address,
- tokenContractName: 'RootChain',
+ address: address,
+ name: 'RootChain',
isParent: true
}, client_);
}

MODIFY
src/pos/root_chain_manager.ts
src/pos/root_chain_manager.ts
@@ -5,8 +5,8 @@ export class RootChainManager extends BaseToken {
constructor(client_: Web3SideChainClient, address: string) {
super({
- tokenAddress: address,
- tokenContractName: 'RootChainManager',
+ address: address,
+ name: 'RootChainManager',
bridgeType: 'pos',
isParent: true
}, client_);

MODIFY
src/utils/base_token.ts
src/utils/base_token.ts
@@ -30,13 +30,13 @@ export class BaseToken {
}
const contractParam = this.contractParam;
return this.client.getABI(
- contractParam.tokenContractName,
+ contractParam.name,
contractParam.bridgeType,
).then(abi => {
this.contract_ = this.getContract_({
abi,
isParent: contractParam.isParent,
- tokenAddress: contractParam.tokenAddress
+ tokenAddress: contractParam.address
});
return this.contract_;
});

change some prop in IContractInitParam