7
7
DonationVotingMerkleDistributionDirectTransferStrategyAbi ,
8
8
DonationVotingMerkleDistributionStrategy ,
9
9
DonationVotingMerkleDistributionStrategyTypes ,
10
+ DirectAllocationStrategy ,
10
11
Registry ,
11
12
RegistryAbi ,
12
13
StrategyFactory ,
@@ -23,7 +24,7 @@ import {
23
24
} from "data-layer" ;
24
25
import { Abi , Address , Hex , getAddress , zeroAddress } from "viem" ;
25
26
import { AnyJson } from "../.." ;
26
- import { UpdateRoundParams , MatchingStatsData } from "../../types" ;
27
+ import { UpdateRoundParams , MatchingStatsData , Allocation } from "../../types" ;
27
28
import { Allo , AlloError , AlloOperation , CreateRoundArguments } from "../allo" ;
28
29
import {
29
30
Result ,
@@ -1483,16 +1484,25 @@ export class AlloV2 implements Allo {
1483
1484
}
1484
1485
}
1485
1486
1486
- const encodeData = utils . defaultAbiCoder . encode (
1487
- [ "address" , "uint256" , "address" , "uint256" ] ,
1488
- [ args . recipient , args . amount , args . tokenAddress , args . nonce ]
1489
- ) ;
1487
+ const strategy = new DirectAllocationStrategy ( {
1488
+ chain : this . chainId ,
1489
+ poolId : BigInt ( args . poolId ) ,
1490
+ } ) ;
1491
+
1492
+ const allocation : Allocation = {
1493
+ profileOwner : args . recipient ,
1494
+ amount : BigInt ( args . amount . toString ( ) ) ,
1495
+ token : args . tokenAddress ,
1496
+ nonce : BigInt ( args . nonce . toString ( ) ) ,
1497
+ } ;
1498
+
1499
+ const txData = strategy . getAllocateData ( allocation ) ;
1490
1500
1491
1501
const tx = await sendTransaction ( this . transactionSender , {
1492
1502
address : this . allo . address ( ) ,
1493
1503
abi : AlloAbi ,
1494
1504
functionName : "allocate" ,
1495
- args : [ poolId , encodeData as Hex ] ,
1505
+ args : [ poolId , txData as Hex ] ,
1496
1506
value : args . tokenAddress === zeroAddress ? args . amount : 0n ,
1497
1507
} ) ;
1498
1508
0 commit comments