Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Merge branch 'feature/certf' of https://github.com/atpar/ap-monorepo
Browse files Browse the repository at this point in the history
…into feature/certf
  • Loading branch information
jo-es committed Jun 23, 2020
2 parents 87572d4 + 324d8e8 commit 9ae3c00
Show file tree
Hide file tree
Showing 33 changed files with 3,715 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ library StateEncoder {
storeInPackedState(asset, "notionalScalingMultiplier", bytes32(state.notionalScalingMultiplier));
storeInPackedState(asset, "nextPrincipalRedemptionPayment", bytes32(state.nextPrincipalRedemptionPayment));
storeInPackedState(asset, "exerciseAmount", bytes32(state.exerciseAmount));

storeInPackedState(asset, "exerciseQuantity", bytes32(state.exerciseQuantity));
storeInPackedState(asset, "quantity", bytes32(state.quantity));
storeInPackedState(asset, "couponAmountFixed", bytes32(state.couponAmountFixed));
storeInPackedState(asset, "marginFactor", bytes32(state.marginFactor));
storeInPackedState(asset, "adjustmentFactor", bytes32(state.adjustmentFactor));
storeInPackedState(asset, "lastCouponDay", bytes32(state.lastCouponDay));
}

/**
Expand All @@ -51,6 +58,13 @@ library StateEncoder {
storeInPackedState(asset, "F_notionalScalingMultiplier", bytes32(state.notionalScalingMultiplier));
storeInPackedState(asset, "F_nextPrincipalRedemptionPayment", bytes32(state.nextPrincipalRedemptionPayment));
storeInPackedState(asset, "F_exerciseAmount", bytes32(state.exerciseAmount));

storeInPackedState(asset, "F_exerciseQuantity", bytes32(state.exerciseQuantity));
storeInPackedState(asset, "F_quantity", bytes32(state.quantity));
storeInPackedState(asset, "F_couponAmountFixed", bytes32(state.couponAmountFixed));
storeInPackedState(asset, "F_marginFactor", bytes32(state.marginFactor));
storeInPackedState(asset, "F_adjustmentFactor", bytes32(state.adjustmentFactor));
storeInPackedState(asset, "F_lastCouponDay", bytes32(state.lastCouponDay));
}

/**
Expand All @@ -64,14 +78,23 @@ library StateEncoder {
uint256(asset.packedState["maturityDate"]),
uint256(asset.packedState["exerciseDate"]),
uint256(asset.packedState["terminationDate"]),

uint256(asset.packedState["lastCouponDay"]),

int256(asset.packedState["notionalPrincipal"]),
int256(asset.packedState["accruedInterest"]),
int256(asset.packedState["feeAccrued"]),
int256(asset.packedState["nominalInterestRate"]),
int256(asset.packedState["interestScalingMultiplier"]),
int256(asset.packedState["notionalScalingMultiplier"]),
int256(asset.packedState["nextPrincipalRedemptionPayment"]),
int256(asset.packedState["exerciseAmount"])
int256(asset.packedState["exerciseAmount"]),

int256(asset.packedState["exerciseQuantity"]),
int256(asset.packedState["quantity"]),
int256(asset.packedState["couponAmountFixed"]),
int256(asset.packedState["marginFactor"]),
int256(asset.packedState["adjustmentFactor"])
);
}

Expand All @@ -86,14 +109,23 @@ library StateEncoder {
uint256(asset.packedState["F_maturityDate"]),
uint256(asset.packedState["F_exerciseDate"]),
uint256(asset.packedState["F_terminationDate"]),

uint256(asset.packedState["F_lastCouponDay"]),

int256(asset.packedState["F_notionalPrincipal"]),
int256(asset.packedState["F_accruedInterest"]),
int256(asset.packedState["F_feeAccrued"]),
int256(asset.packedState["F_nominalInterestRate"]),
int256(asset.packedState["F_interestScalingMultiplier"]),
int256(asset.packedState["F_notionalScalingMultiplier"]),
int256(asset.packedState["F_nextPrincipalRedemptionPayment"]),
int256(asset.packedState["F_exerciseAmount"])
int256(asset.packedState["F_exerciseAmount"]),

int256(asset.packedState["F_exerciseQuantity"]),
int256(asset.packedState["F_quantity"]),
int256(asset.packedState["F_couponAmountFixed"]),
int256(asset.packedState["F_marginFactor"]),
int256(asset.packedState["F_adjustmentFactor"])
);
}

Expand Down
270 changes: 146 additions & 124 deletions packages/ap-contracts/contracts/Core/CERTF/CERTFEncoder.sol

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/ap-contracts/contracts/external/Dependencies.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "@atpar/actus-solidity/contracts/Engines/ANN/ANNEngine.sol";
import "@atpar/actus-solidity/contracts/Engines/CEC/CECEngine.sol";
import "@atpar/actus-solidity/contracts/Engines/CEG/CEGEngine.sol";
import "@atpar/actus-solidity/contracts/Engines/PAM/PAMEngine.sol";
import "@atpar/actus-solidity/contracts/Engines/CERTF/CERTFEngine.sol";


contract Dependencies {}
36 changes: 36 additions & 0 deletions packages/ap-contracts/ts-bindings/ANNEngine.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export class ANNEngine extends Contract {
maturityDate: number | string;
exerciseDate: number | string;
terminationDate: number | string;
lastCouponDay: number | string;
notionalPrincipal: number | string;
accruedInterest: number | string;
feeAccrued: number | string;
Expand All @@ -157,6 +158,11 @@ export class ANNEngine extends Contract {
notionalScalingMultiplier: number | string;
nextPrincipalRedemptionPayment: number | string;
exerciseAmount: number | string;
exerciseQuantity: number | string;
quantity: number | string;
couponAmountFixed: number | string;
marginFactor: number | string;
adjustmentFactor: number | string;
},
_event: string | number[],
externalData: string | number[]
Expand All @@ -167,6 +173,7 @@ export class ANNEngine extends Contract {
maturityDate: string;
exerciseDate: string;
terminationDate: string;
lastCouponDay: string;
notionalPrincipal: string;
accruedInterest: string;
feeAccrued: string;
Expand All @@ -175,6 +182,11 @@ export class ANNEngine extends Contract {
notionalScalingMultiplier: string;
nextPrincipalRedemptionPayment: string;
exerciseAmount: string;
exerciseQuantity: string;
quantity: string;
couponAmountFixed: string;
marginFactor: string;
adjustmentFactor: string;
}>;

computePayoffForEvent(
Expand Down Expand Up @@ -263,6 +275,7 @@ export class ANNEngine extends Contract {
maturityDate: number | string;
exerciseDate: number | string;
terminationDate: number | string;
lastCouponDay: number | string;
notionalPrincipal: number | string;
accruedInterest: number | string;
feeAccrued: number | string;
Expand All @@ -271,6 +284,11 @@ export class ANNEngine extends Contract {
notionalScalingMultiplier: number | string;
nextPrincipalRedemptionPayment: number | string;
exerciseAmount: number | string;
exerciseQuantity: number | string;
quantity: number | string;
couponAmountFixed: number | string;
marginFactor: number | string;
adjustmentFactor: number | string;
},
_event: string | number[],
externalData: string | number[]
Expand Down Expand Up @@ -360,6 +378,7 @@ export class ANNEngine extends Contract {
maturityDate: string;
exerciseDate: string;
terminationDate: string;
lastCouponDay: string;
notionalPrincipal: string;
accruedInterest: string;
feeAccrued: string;
Expand All @@ -368,6 +387,11 @@ export class ANNEngine extends Contract {
notionalScalingMultiplier: string;
nextPrincipalRedemptionPayment: string;
exerciseAmount: string;
exerciseQuantity: string;
quantity: string;
couponAmountFixed: string;
marginFactor: string;
adjustmentFactor: string;
}>;

computeNonCyclicScheduleSegment(
Expand Down Expand Up @@ -624,6 +648,7 @@ export class ANNEngine extends Contract {
maturityDate: number | string;
exerciseDate: number | string;
terminationDate: number | string;
lastCouponDay: number | string;
notionalPrincipal: number | string;
accruedInterest: number | string;
feeAccrued: number | string;
Expand All @@ -632,6 +657,11 @@ export class ANNEngine extends Contract {
notionalScalingMultiplier: number | string;
nextPrincipalRedemptionPayment: number | string;
exerciseAmount: number | string;
exerciseQuantity: number | string;
quantity: number | string;
couponAmountFixed: number | string;
marginFactor: number | string;
adjustmentFactor: number | string;
},
arg3: boolean,
arg4: {
Expand All @@ -641,6 +671,7 @@ export class ANNEngine extends Contract {
maturityDate: number | string;
exerciseDate: number | string;
terminationDate: number | string;
lastCouponDay: number | string;
notionalPrincipal: number | string;
accruedInterest: number | string;
feeAccrued: number | string;
Expand All @@ -649,6 +680,11 @@ export class ANNEngine extends Contract {
notionalScalingMultiplier: number | string;
nextPrincipalRedemptionPayment: number | string;
exerciseAmount: number | string;
exerciseQuantity: number | string;
quantity: number | string;
couponAmountFixed: number | string;
marginFactor: number | string;
adjustmentFactor: number | string;
}
): TransactionObject<boolean>;
};
Expand Down
30 changes: 30 additions & 0 deletions packages/ap-contracts/ts-bindings/ANNRegistry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class ANNRegistry extends Contract {
maturityDate: string;
exerciseDate: string;
terminationDate: string;
lastCouponDay: string;
notionalPrincipal: string;
accruedInterest: string;
feeAccrued: string;
Expand All @@ -85,6 +86,11 @@ export class ANNRegistry extends Contract {
notionalScalingMultiplier: string;
nextPrincipalRedemptionPayment: string;
exerciseAmount: string;
exerciseQuantity: string;
quantity: string;
couponAmountFixed: string;
marginFactor: string;
adjustmentFactor: string;
}>;

getIntValueForStateAttribute(
Expand Down Expand Up @@ -126,6 +132,7 @@ export class ANNRegistry extends Contract {
maturityDate: string;
exerciseDate: string;
terminationDate: string;
lastCouponDay: string;
notionalPrincipal: string;
accruedInterest: string;
feeAccrued: string;
Expand All @@ -134,6 +141,11 @@ export class ANNRegistry extends Contract {
notionalScalingMultiplier: string;
nextPrincipalRedemptionPayment: string;
exerciseAmount: string;
exerciseQuantity: string;
quantity: string;
couponAmountFixed: string;
marginFactor: string;
adjustmentFactor: string;
}>;

getUintValueForStateAttribute(
Expand Down Expand Up @@ -230,6 +242,7 @@ export class ANNRegistry extends Contract {
maturityDate: number | string;
exerciseDate: number | string;
terminationDate: number | string;
lastCouponDay: number | string;
notionalPrincipal: number | string;
accruedInterest: number | string;
feeAccrued: number | string;
Expand All @@ -238,6 +251,11 @@ export class ANNRegistry extends Contract {
notionalScalingMultiplier: number | string;
nextPrincipalRedemptionPayment: number | string;
exerciseAmount: number | string;
exerciseQuantity: number | string;
quantity: number | string;
couponAmountFixed: number | string;
marginFactor: number | string;
adjustmentFactor: number | string;
}
): TransactionObject<void>;

Expand All @@ -250,6 +268,7 @@ export class ANNRegistry extends Contract {
maturityDate: number | string;
exerciseDate: number | string;
terminationDate: number | string;
lastCouponDay: number | string;
notionalPrincipal: number | string;
accruedInterest: number | string;
feeAccrued: number | string;
Expand All @@ -258,6 +277,11 @@ export class ANNRegistry extends Contract {
notionalScalingMultiplier: number | string;
nextPrincipalRedemptionPayment: number | string;
exerciseAmount: number | string;
exerciseQuantity: number | string;
quantity: number | string;
couponAmountFixed: number | string;
marginFactor: number | string;
adjustmentFactor: number | string;
}
): TransactionObject<void>;

Expand Down Expand Up @@ -348,6 +372,7 @@ export class ANNRegistry extends Contract {
maturityDate: number | string;
exerciseDate: number | string;
terminationDate: number | string;
lastCouponDay: number | string;
notionalPrincipal: number | string;
accruedInterest: number | string;
feeAccrued: number | string;
Expand All @@ -356,6 +381,11 @@ export class ANNRegistry extends Contract {
notionalScalingMultiplier: number | string;
nextPrincipalRedemptionPayment: number | string;
exerciseAmount: number | string;
exerciseQuantity: number | string;
quantity: number | string;
couponAmountFixed: number | string;
marginFactor: number | string;
adjustmentFactor: number | string;
},
schedule: (string | number[])[],
ownership: {
Expand Down
24 changes: 24 additions & 0 deletions packages/ap-contracts/ts-bindings/BaseRegistry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class BaseRegistry extends Contract {
maturityDate: string;
exerciseDate: string;
terminationDate: string;
lastCouponDay: string;
notionalPrincipal: string;
accruedInterest: string;
feeAccrued: string;
Expand All @@ -111,6 +112,11 @@ export class BaseRegistry extends Contract {
notionalScalingMultiplier: string;
nextPrincipalRedemptionPayment: string;
exerciseAmount: string;
exerciseQuantity: string;
quantity: string;
couponAmountFixed: string;
marginFactor: string;
adjustmentFactor: string;
}>;

getIntValueForForTermsAttribute(
Expand Down Expand Up @@ -162,6 +168,7 @@ export class BaseRegistry extends Contract {
maturityDate: string;
exerciseDate: string;
terminationDate: string;
lastCouponDay: string;
notionalPrincipal: string;
accruedInterest: string;
feeAccrued: string;
Expand All @@ -170,6 +177,11 @@ export class BaseRegistry extends Contract {
notionalScalingMultiplier: string;
nextPrincipalRedemptionPayment: string;
exerciseAmount: string;
exerciseQuantity: string;
quantity: string;
couponAmountFixed: string;
marginFactor: string;
adjustmentFactor: string;
}>;

getUIntValueForForTermsAttribute(
Expand Down Expand Up @@ -259,6 +271,7 @@ export class BaseRegistry extends Contract {
maturityDate: number | string;
exerciseDate: number | string;
terminationDate: number | string;
lastCouponDay: number | string;
notionalPrincipal: number | string;
accruedInterest: number | string;
feeAccrued: number | string;
Expand All @@ -267,6 +280,11 @@ export class BaseRegistry extends Contract {
notionalScalingMultiplier: number | string;
nextPrincipalRedemptionPayment: number | string;
exerciseAmount: number | string;
exerciseQuantity: number | string;
quantity: number | string;
couponAmountFixed: number | string;
marginFactor: number | string;
adjustmentFactor: number | string;
}
): TransactionObject<void>;

Expand All @@ -279,6 +297,7 @@ export class BaseRegistry extends Contract {
maturityDate: number | string;
exerciseDate: number | string;
terminationDate: number | string;
lastCouponDay: number | string;
notionalPrincipal: number | string;
accruedInterest: number | string;
feeAccrued: number | string;
Expand All @@ -287,6 +306,11 @@ export class BaseRegistry extends Contract {
notionalScalingMultiplier: number | string;
nextPrincipalRedemptionPayment: number | string;
exerciseAmount: number | string;
exerciseQuantity: number | string;
quantity: number | string;
couponAmountFixed: number | string;
marginFactor: number | string;
adjustmentFactor: number | string;
}
): TransactionObject<void>;

Expand Down
Loading

0 comments on commit 9ae3c00

Please sign in to comment.