|
2 | 2 | AlloAbi, |
3 | 3 | Allo as AlloV2Contract, |
4 | 4 | CreateProfileArgs, |
| 5 | + DirectAllocationStrategy, |
5 | 6 | DirectGrantsLiteStrategy, |
6 | 7 | DirectGrantsLiteStrategyTypes, |
7 | 8 | DonationVotingMerkleDistributionDirectTransferStrategyAbi, |
@@ -1496,19 +1497,40 @@ export class AlloV2 implements Allo { |
1496 | 1497 | _token = getAddress(NATIVE); |
1497 | 1498 | } |
1498 | 1499 |
|
1499 | | - const encodeData = utils.defaultAbiCoder.encode( |
1500 | | - ["address", "uint256", "address", "uint256"], |
1501 | | - [args.recipient, args.amount, _token, args.nonce] |
| 1500 | + |
| 1501 | + const strategy = new DirectAllocationStrategy({ |
| 1502 | + chain: this.chainId, |
| 1503 | + poolId: poolId, |
| 1504 | + }); |
| 1505 | + |
| 1506 | + const txData = strategy.getAllocateData( |
| 1507 | + { |
| 1508 | + profileOwner: args.recipient, |
| 1509 | + amount: BigInt(args.amount.toString()), |
| 1510 | + token: _token, |
| 1511 | + nonce: args.nonce, |
| 1512 | + }, |
1502 | 1513 | ); |
1503 | 1514 |
|
1504 | | - const tx = await sendTransaction(this.transactionSender, { |
1505 | | - address: this.allo.address(), |
1506 | | - abi: AlloAbi, |
1507 | | - functionName: "allocate", |
1508 | | - args: [poolId, encodeData as Hex], |
1509 | | - value: args.tokenAddress === zeroAddress ? args.amount : 0n, |
| 1515 | + const tx = await sendRawTransaction(this.transactionSender, { |
| 1516 | + to: txData.to, |
| 1517 | + data: txData.data, |
| 1518 | + value: BigInt(txData.value), |
1510 | 1519 | }); |
1511 | 1520 |
|
| 1521 | + // const encodeData = utils.defaultAbiCoder.encode( |
| 1522 | + // ["address", "uint256", "address", "uint256"], |
| 1523 | + // [args.recipient, args.amount, _token, args.nonce] |
| 1524 | + // ); |
| 1525 | + |
| 1526 | + // const tx = await sendTransaction(this.transactionSender, { |
| 1527 | + // address: this.allo.address(), |
| 1528 | + // abi: AlloAbi, |
| 1529 | + // functionName: "allocate", |
| 1530 | + // args: [poolId, encodeData as Hex], |
| 1531 | + // value: args.tokenAddress === zeroAddress ? args.amount : 0n, |
| 1532 | + // }); |
| 1533 | + |
1512 | 1534 | emit("transaction", tx); |
1513 | 1535 |
|
1514 | 1536 | if (tx.type === "error") { |
|
0 commit comments