Skip to content

Commit 88621d3

Browse files
authored
Merge 3e83c57 into 4703fa9
2 parents 4703fa9 + 3e83c57 commit 88621d3

24 files changed

+821
-48
lines changed

.env.example

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
export DEPLOYER_PRIVATE_KEY="YOUR_PRIVATE_KEY"
2-
export MNEMONIC="YOUR_MNEMONIC"
3-
export API_KEY_ALCHEMY="YOUR_ALCHEMY_API_KEY"
4-
export API_KEY_INFURA="YOUR_INFURA_API_KEY"
1+
export DEPLOYER_PRIVATE_KEY="your api key"
2+
export API_KEY_ALCHEMY="your api key"
3+
export API_KEY_INFURA="your api key"
54

6-
export API_KEY_ETHERSCAN="YOUR_ETHERSCAN_API_KEY"
7-
export API_KEY_OPTIMISTIC_ETHERSCAN="YOUR_OPTIMISTIC_ETHERSCAN_API_KEY"
5+
export API_KEY_ARBISCAN="your api key"
6+
export API_KEY_BASESCAN="your api key"
7+
export API_KEY_ETHERSCAN="your api key"
8+
export API_KEY_OPTIMISTIC_ETHERSCAN="your api key"
9+
export API_KEY_CELOSCAN="your api key"
810
export NEMONIC="test test test test test test test test test test test test"

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ env:
1111
API_KEY_OPTIMISTIC_ETHERSCAN: ${{secrets.API_KEY_OPTIMISTIC_ETHERSCAN}}
1212
API_KEY_ETHERSCAN: ${{secrets.API_KEY_ETHERSCAN}}
1313
API_KEY_ALCHEMY: ${{secrets.API_KEY_ALCHEMY}}
14+
API_KEY_ARBISCAN: ${{${{secrets.API_KEY_ARBISCAN}}
15+
API_KEY_BASESCAN: ${{secrets.API_KEY_BASESCAN}}
16+
API_KEY_CELOSCAN: ${{secrets.API_KEY_CELOSCAN}}
1417

1518
jobs:
1619
build:

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "lib/openzeppelin-contracts-upgradeable"]
88
path = lib/openzeppelin-contracts-upgradeable
99
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
10+
[submodule "lib/hypercerts-protocol"]
11+
path = lib/hypercerts-protocol
12+
url = https://github.com/hypercerts-org/hypercerts-protocol

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
## Implementation
77

88
### BatchTransferFraction
9+
910
```mermaid
1011
sequenceDiagram
1112
actor o as Owner
@@ -23,6 +24,7 @@ b ->> r: safeTransferFrom()
2324
end
2425
2526
```
27+
2628
```solidity
2729
/// @dev msg.sender must be the owner of all the fraction IDs being transferred
2830
/// @dev msg.sender must have approved the contract to transfer the fractions
@@ -32,7 +34,6 @@ end
3234
require(data.length > 0, INVALID_DATA());
3335
TransferData memory transferData = abi.decode(data, (TransferData));
3436
require(transferData.recipients.length == transferData.fractionIds.length, INVALID_LENGTHS());
35-
3637
_batchTransfer(transferData.recipients, transferData.fractionIds);
3738
}
3839
@@ -42,12 +43,28 @@ end
4243
/// @param recipients The addresses of the recipients
4344
/// @param fractionIds The IDs of the fractions to be transferred
4445
function _batchTransfer(address[] memory recipients, uint256[] memory fractionIds) internal {
45-
for (uint256 i = 0; i < recipients.length; i++) {
46+
uint256 length = recipients.length;
47+
for (uint256 i = 0; i < length; i++) {
4648
address recipient = recipients[i];
4749
uint256 fractionId = fractionIds[i];
4850
require(hypercertToken.ownerOf(fractionId) == msg.sender, INVALID_CALLER(msg.sender));
4951
5052
hypercertToken.safeTransferFrom(msg.sender, recipient, fractionId, 1, "");
5153
}
54+
emit BatchFractionTransfer(msg.sender, recipients, fractionIds);
5255
}
5356
```
57+
58+
## Deployments
59+
60+
### BatchTransferFraction
61+
62+
| chain | chainId | address |
63+
| ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
64+
| Sepolia | 11155111 | [0x59e07f1cc8eb8eca2703179a7217673318a0fe47](https://sepolia.etherscan.io/address/0x59e07f1cc8eb8eca2703179a7217673318a0fe47) |
65+
| Base Sepolia | 84532 | [0x3C0FaAA04078d715BB05Af82Ca99c41623AeC5Ae](https://sepolia.basescan.org/address/0x3C0FaAA04078d715BB05Af82Ca99c41623AeC5Ae) |
66+
| Arbitrum Sepolia | 421614 | [0x0fCCa2bAd3103934304874E782450688B7a044B0](https://sepolia.arbiscan.io/address/0x0fCCa2bAd3103934304874E782450688B7a044B0) |
67+
| Optimism | 10 | [0xf77e452ec289da0616574aae371800ca4d6315b1](https://optimistic.etherscan.io/address/0xf77e452ec289da0616574aae371800ca4d6315b1) |
68+
| Base | 8453 | [0xc4aEB039BC432343bf4dB57Be203E0540d385a18](https://basescan.org/address/0xc4aEB039BC432343bf4dB57Be203E0540d385a18) |
69+
| Arbitrum | 42161 | [0x8b973c408c2748588b3ECFfDA06D670819FbEb1D](https://arbiscan.io/address/0x8b973c408c2748588b3ECFfDA06D670819FbEb1D) |
70+
| Celo | 42220 | [0xB64B7e4793D72958e028B1D5D556888b115c4c3E](https://celoscan.io/address/0xB64B7e4793D72958e028B1D5D556888b115c4c3E) |
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"transactions": [
3+
{
4+
"hash": "0x731098a5ade3bfca43aee36be56e4d0395f16186a508c69da5869fffe0259c50",
5+
"transactionType": "CREATE",
6+
"contractName": "BatchTransferFraction",
7+
"contractAddress": "0xf77e452ec289da0616574aae371800ca4d6315b1",
8+
"function": null,
9+
"arguments": [
10+
"0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07"
11+
],
12+
"transaction": {
13+
"from": "0xc3593524e2744e547f013e17e6b0776bc27fc614",
14+
"gas": "0x84ba9",
15+
"value": "0x0",
16+
"input": "0x60a060405234801561000f575f5ffd5b5060405161075738038061075783398101604081905261002e91610078565b806001600160a01b03811661006657604051637f4c3a8160e11b81526001600160a01b03909116600482015260240160405180910390fd5b506001600160a01b03166080526100a5565b5f60208284031215610088575f5ffd5b81516001600160a01b038116811461009e575f5ffd5b9392505050565b60805161068d6100ca5f395f8181605201528181610157015261025c015261068d5ff3fe608060405234801561000f575f5ffd5b5060043610610034575f3560e01c806310a890af14610038578063f49bdbea1461004d575b5f5ffd5b61004b61004636600461038a565b610090565b005b6100747f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b5f8151116100b157604051630e34c5ef60e11b815260040160405180910390fd5b5f818060200190518101906100c691906104c6565b602081015151815151919250146100f05760405163194374f160e11b815260040160405180910390fd5b610101815f01518260200151610105565b5050565b81515f5b818110156102c1575f848281518110610124576101246105bb565b602002602001015190505f848381518110610141576101416105bb565b60200260200101519050336001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636352211e836040518263ffffffff1660e01b81526004016101a391815260200190565b602060405180830381865afa1580156101be573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101e291906105cf565b6001600160a01b031614339061021b5760405163eb804abb60e01b81526001600160a01b03909116600482015260240160405180910390fd5b50604051637921219560e11b81523360048201526001600160a01b038381166024830152604482018390526001606483015260a060848301525f60a48301527f0000000000000000000000000000000000000000000000000000000000000000169063f242432a9060c4015f604051808303815f87803b15801561029d575f5ffd5b505af11580156102af573d5f5f3e3d5ffd5b50506001909401935061010992505050565b50816040516102d091906105ef565b6040518091039020836040516102e69190610624565b6040519081900381209033907f3f3c2c4ea143a2e27fbc736ce3268927ae97ed1db155207ffe0adfaff84cc3cb905f90a4505050565b634e487b7160e01b5f52604160045260245ffd5b6040805190810167ffffffffffffffff811182821017156103535761035361031c565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156103825761038261031c565b604052919050565b5f6020828403121561039a575f5ffd5b813567ffffffffffffffff8111156103b0575f5ffd5b8201601f810184136103c0575f5ffd5b803567ffffffffffffffff8111156103da576103da61031c565b6103ed601f8201601f1916602001610359565b818152856020838501011115610401575f5ffd5b816020840160208301375f91810160200191909152949350505050565b5f67ffffffffffffffff8211156104375761043761031c565b5060051b60200190565b80516001600160a01b0381168114610457575f5ffd5b919050565b5f82601f83011261046b575f5ffd5b815161047e6104798261041e565b610359565b8082825260208201915060208360051b86010192508583111561049f575f5ffd5b602085015b838110156104bc5780518352602092830192016104a4565b5095945050505050565b5f602082840312156104d6575f5ffd5b815167ffffffffffffffff8111156104ec575f5ffd5b8201604081850312156104fd575f5ffd5b610505610330565b815167ffffffffffffffff81111561051b575f5ffd5b8201601f8101861361052b575f5ffd5b80516105396104798261041e565b8082825260208201915060208360051b85010192508883111561055a575f5ffd5b6020840193505b828410156105835761057284610441565b825260209384019390910190610561565b8452505050602082015167ffffffffffffffff8111156105a1575f5ffd5b6105ad8682850161045c565b602083015250949350505050565b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156105df575f5ffd5b6105e882610441565b9392505050565b81515f90829060208501835b828110156106195781518452602093840193909101906001016105fb565b509195945050505050565b81515f90829060208501835b828110156106195781516001600160a01b031684526020938401939091019060010161063056fea264697066735822122003733715a5bbed9d5d35546e5acca39a8821fadeb212ae4b1651b4978a7a79f964736f6c634300081c0033000000000000000000000000822f17a9a5eecfd66dbaff7946a8071c265d1d07",
17+
"nonce": "0x3b",
18+
"chainId": "0xa"
19+
},
20+
"additionalContracts": [],
21+
"isFixedGasLimit": false
22+
}
23+
],
24+
"receipts": [
25+
{
26+
"status": "0x1",
27+
"cumulativeGasUsed": "0x5eca0e",
28+
"logs": [],
29+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
30+
"type": "0x2",
31+
"transactionHash": "0x731098a5ade3bfca43aee36be56e4d0395f16186a508c69da5869fffe0259c50",
32+
"transactionIndex": "0x14",
33+
"blockHash": "0xb33570f608b9fb11ccfa5681bc1de1077f0b4404e8fb279f8e97979dbd8ffb3a",
34+
"blockNumber": "0x80db81b",
35+
"gasUsed": "0x66196",
36+
"effectiveGasPrice": "0x30f",
37+
"from": "0xc3593524e2744e547f013e17e6b0776bc27fc614",
38+
"to": null,
39+
"contractAddress": "0xf77e452ec289da0616574aae371800ca4d6315b1",
40+
"l1BaseFeeScalar": "0x146b",
41+
"l1BlobBaseFee": "0x16d24cb01",
42+
"l1BlobBaseFeeScalar": "0xf79c5",
43+
"l1Fee": "0x6c50946dce5",
44+
"l1GasPrice": "0x1c30c8d7",
45+
"l1GasUsed": "0x4a66"
46+
}
47+
],
48+
"libraries": [],
49+
"pending": [],
50+
"returns": {},
51+
"timestamp": 1745832438,
52+
"chain": 10,
53+
"commit": "4ee5d8e"
54+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"transactions": [
3+
{
4+
"hash": "0x731098a5ade3bfca43aee36be56e4d0395f16186a508c69da5869fffe0259c50",
5+
"transactionType": "CREATE",
6+
"contractName": "BatchTransferFraction",
7+
"contractAddress": "0xf77e452ec289da0616574aae371800ca4d6315b1",
8+
"function": null,
9+
"arguments": [
10+
"0x822F17A9A5EeCFd66dBAFf7946a8071C265D1d07"
11+
],
12+
"transaction": {
13+
"from": "0xc3593524e2744e547f013e17e6b0776bc27fc614",
14+
"gas": "0x84ba9",
15+
"value": "0x0",
16+
"input": "0x60a060405234801561000f575f5ffd5b5060405161075738038061075783398101604081905261002e91610078565b806001600160a01b03811661006657604051637f4c3a8160e11b81526001600160a01b03909116600482015260240160405180910390fd5b506001600160a01b03166080526100a5565b5f60208284031215610088575f5ffd5b81516001600160a01b038116811461009e575f5ffd5b9392505050565b60805161068d6100ca5f395f8181605201528181610157015261025c015261068d5ff3fe608060405234801561000f575f5ffd5b5060043610610034575f3560e01c806310a890af14610038578063f49bdbea1461004d575b5f5ffd5b61004b61004636600461038a565b610090565b005b6100747f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b5f8151116100b157604051630e34c5ef60e11b815260040160405180910390fd5b5f818060200190518101906100c691906104c6565b602081015151815151919250146100f05760405163194374f160e11b815260040160405180910390fd5b610101815f01518260200151610105565b5050565b81515f5b818110156102c1575f848281518110610124576101246105bb565b602002602001015190505f848381518110610141576101416105bb565b60200260200101519050336001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636352211e836040518263ffffffff1660e01b81526004016101a391815260200190565b602060405180830381865afa1580156101be573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101e291906105cf565b6001600160a01b031614339061021b5760405163eb804abb60e01b81526001600160a01b03909116600482015260240160405180910390fd5b50604051637921219560e11b81523360048201526001600160a01b038381166024830152604482018390526001606483015260a060848301525f60a48301527f0000000000000000000000000000000000000000000000000000000000000000169063f242432a9060c4015f604051808303815f87803b15801561029d575f5ffd5b505af11580156102af573d5f5f3e3d5ffd5b50506001909401935061010992505050565b50816040516102d091906105ef565b6040518091039020836040516102e69190610624565b6040519081900381209033907f3f3c2c4ea143a2e27fbc736ce3268927ae97ed1db155207ffe0adfaff84cc3cb905f90a4505050565b634e487b7160e01b5f52604160045260245ffd5b6040805190810167ffffffffffffffff811182821017156103535761035361031c565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156103825761038261031c565b604052919050565b5f6020828403121561039a575f5ffd5b813567ffffffffffffffff8111156103b0575f5ffd5b8201601f810184136103c0575f5ffd5b803567ffffffffffffffff8111156103da576103da61031c565b6103ed601f8201601f1916602001610359565b818152856020838501011115610401575f5ffd5b816020840160208301375f91810160200191909152949350505050565b5f67ffffffffffffffff8211156104375761043761031c565b5060051b60200190565b80516001600160a01b0381168114610457575f5ffd5b919050565b5f82601f83011261046b575f5ffd5b815161047e6104798261041e565b610359565b8082825260208201915060208360051b86010192508583111561049f575f5ffd5b602085015b838110156104bc5780518352602092830192016104a4565b5095945050505050565b5f602082840312156104d6575f5ffd5b815167ffffffffffffffff8111156104ec575f5ffd5b8201604081850312156104fd575f5ffd5b610505610330565b815167ffffffffffffffff81111561051b575f5ffd5b8201601f8101861361052b575f5ffd5b80516105396104798261041e565b8082825260208201915060208360051b85010192508883111561055a575f5ffd5b6020840193505b828410156105835761057284610441565b825260209384019390910190610561565b8452505050602082015167ffffffffffffffff8111156105a1575f5ffd5b6105ad8682850161045c565b602083015250949350505050565b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156105df575f5ffd5b6105e882610441565b9392505050565b81515f90829060208501835b828110156106195781518452602093840193909101906001016105fb565b509195945050505050565b81515f90829060208501835b828110156106195781516001600160a01b031684526020938401939091019060010161063056fea264697066735822122003733715a5bbed9d5d35546e5acca39a8821fadeb212ae4b1651b4978a7a79f964736f6c634300081c0033000000000000000000000000822f17a9a5eecfd66dbaff7946a8071c265d1d07",
17+
"nonce": "0x3b",
18+
"chainId": "0xa"
19+
},
20+
"additionalContracts": [],
21+
"isFixedGasLimit": false
22+
}
23+
],
24+
"receipts": [
25+
{
26+
"status": "0x1",
27+
"cumulativeGasUsed": "0x5eca0e",
28+
"logs": [],
29+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
30+
"type": "0x2",
31+
"transactionHash": "0x731098a5ade3bfca43aee36be56e4d0395f16186a508c69da5869fffe0259c50",
32+
"transactionIndex": "0x14",
33+
"blockHash": "0xb33570f608b9fb11ccfa5681bc1de1077f0b4404e8fb279f8e97979dbd8ffb3a",
34+
"blockNumber": "0x80db81b",
35+
"gasUsed": "0x66196",
36+
"effectiveGasPrice": "0x30f",
37+
"from": "0xc3593524e2744e547f013e17e6b0776bc27fc614",
38+
"to": null,
39+
"contractAddress": "0xf77e452ec289da0616574aae371800ca4d6315b1",
40+
"l1BaseFeeScalar": "0x146b",
41+
"l1BlobBaseFee": "0x16d24cb01",
42+
"l1BlobBaseFeeScalar": "0xf79c5",
43+
"l1Fee": "0x6c50946dce5",
44+
"l1GasPrice": "0x1c30c8d7",
45+
"l1GasUsed": "0x4a66"
46+
}
47+
],
48+
"libraries": [],
49+
"pending": [],
50+
"returns": {},
51+
"timestamp": 1745832438,
52+
"chain": 10,
53+
"commit": "4ee5d8e"
54+
}

0 commit comments

Comments
 (0)