-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(managers): adds new managers and getFactory static method
- Loading branch information
1 parent
5c1223f
commit e50a7ec
Showing
13 changed files
with
115 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Interface } from '@ethersproject/abi' | ||
import { Signer } from '@ethersproject/abstract-signer' | ||
import { ContractFactory } from '@ethersproject/contracts' | ||
|
||
import PositionDescriptorArtifact from '@primitivefi/rmm-manager/artifacts/contracts/PositionDescriptor.sol/PositionDescriptor.json' | ||
|
||
/** | ||
* Abstract class for PositionDescriptor. | ||
* | ||
* @beta | ||
*/ | ||
export abstract class PositionDescriptorManager { | ||
public static INTERFACE: Interface = new Interface(PositionDescriptorArtifact.abi) | ||
public static BYTECODE: string = PositionDescriptorArtifact.bytecode | ||
public static ABI: any[] = PositionDescriptorArtifact.abi | ||
public static getFactory: (signer?: Signer) => ContractFactory = signer => | ||
new ContractFactory(PositionDescriptorManager.INTERFACE, PositionDescriptorManager.BYTECODE, signer) | ||
|
||
private constructor() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Interface } from '@ethersproject/abi' | ||
import { Signer } from '@ethersproject/abstract-signer' | ||
import { ContractFactory } from '@ethersproject/contracts' | ||
|
||
import PositionRendererArtifact from '@primitivefi/rmm-manager/artifacts/contracts/PositionRenderer.sol/PositionRenderer.json' | ||
|
||
/** | ||
* Abstract class for PositionRenderer. | ||
* | ||
* @beta | ||
*/ | ||
export abstract class PositionRendererManager { | ||
public static INTERFACE: Interface = new Interface(PositionRendererArtifact.abi) | ||
public static BYTECODE: string = PositionRendererArtifact.bytecode | ||
public static ABI: any[] = PositionRendererArtifact.abi | ||
public static getFactory: (signer?: Signer) => ContractFactory = signer => | ||
new ContractFactory(PositionRendererManager.INTERFACE, PositionRendererManager.BYTECODE, signer) | ||
|
||
private constructor() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { PositionDescriptorManager } from '../src/positionDescriptorManager' | ||
import { ContractFactory } from 'ethers' | ||
|
||
describe('PositionDescriptorManager', function() { | ||
describe('#getFactory', function() { | ||
it('getFactory returns the ethers factory', async function() { | ||
expect(PositionDescriptorManager.getFactory()).toStrictEqual( | ||
new ContractFactory(PositionDescriptorManager.INTERFACE, PositionDescriptorManager.BYTECODE) | ||
) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { PositionRendererManager } from '../src/positionRendererManager' | ||
import { ContractFactory } from 'ethers' | ||
|
||
describe('PositionRendererManager', function() { | ||
describe('#getFactory', function() { | ||
it('successful', async function() { | ||
expect(PositionRendererManager.getFactory()).toStrictEqual( | ||
new ContractFactory(PositionRendererManager.INTERFACE, PositionRendererManager.BYTECODE) | ||
) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters