fix function params
This commit is contained in:
parent
b0e5b23c84
commit
dcbaafe823
1 changed files with 4 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ let decimals: BigDecimal = BigDecimal.fromString("1000000000000000000");
|
|||
let totalSupply: BigDecimal = BigDecimal.fromString("10000000000000000000000000");
|
||||
let taxRates: Array<string> = ["0.01", "0.03", "0.05", "0.08", "0.12", "0.18", "0.24", "0.30", "0.40", "0.50", "0.60", "0.80", "1", "1.3", "1.8", "2.5", "3.2", "4.2", "5.4", "7", "9.2", "12", "16", "20", "26", "34", "44", "57", "75", "97"];
|
||||
|
||||
export function handlePositionCreated(event: PositionCreatedEvent, subgraphConfig: SubgraphConfig = getSubgraphConfig()): void {
|
||||
export function handlePositionCreated(event: PositionCreatedEvent): void {
|
||||
let position = new Position(Bytes.fromI32(event.params.positionId.toI32()));
|
||||
position.owner = event.params.owner;
|
||||
position.share = event.params.share.toBigDecimal().div(totalSupply);
|
||||
|
|
@ -27,7 +27,7 @@ export function handlePositionCreated(event: PositionCreatedEvent, subgraphConfi
|
|||
position.snatched = 0;
|
||||
position.payout = BigInt.fromString("0");
|
||||
position.taxPaid = BigInt.fromString("0");
|
||||
let harb = Harb.bind(subgraphConfig.harbergAddress);
|
||||
let harb = Harb.bind(getSubgraphConfig().harbergAddress);
|
||||
position.totalSupplyInit = harb.totalSupply();
|
||||
position.save();
|
||||
let stake = Stake.bind(event.address);
|
||||
|
|
@ -38,11 +38,11 @@ export function handlePositionCreated(event: PositionCreatedEvent, subgraphConfi
|
|||
}
|
||||
}
|
||||
|
||||
export function handlePositionRemoved(event: PositionRemovedEvent, subgraphConfig: SubgraphConfig = getSubgraphConfig()): void {
|
||||
export function handlePositionRemoved(event: PositionRemovedEvent): void {
|
||||
let position = Position.load(Bytes.fromI32(event.params.positionId.toI32()));
|
||||
if (position != null) {
|
||||
position.status = "Closed";
|
||||
let harb = Harb.bind(subgraphConfig.harbergAddress);
|
||||
let harb = Harb.bind(getSubgraphConfig().harbergAddress);
|
||||
position.totalSupplyEnd = harb.totalSupply();
|
||||
position.payout = position.payout.plus(event.params.harbergPayout);
|
||||
position.save();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue