Skip to content

Commit 7458947

Browse files
committed
update
1 parent fe46ddc commit 7458947

File tree

61 files changed

+4089
-12004
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+4089
-12004
lines changed

package-lock.json

Lines changed: 3530 additions & 11829 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,21 @@
6767
"@metamask/providers": "^22.1.1",
6868
"@nanostores/preact": "^0.5.2",
6969
"@nanostores/react": "^0.8.4",
70-
"astro": "^5.14.6",
70+
"@openzeppelin/contracts": "5.4.0",
7171
"@solana-program/compute-budget": "^0.10.0",
7272
"@solana-program/system": "^0.9.0",
7373
"@solana-program/token": "^0.7.0",
7474
"@solana-program/token-2022": "^0.6.0",
7575
"@solana/kit": "^4.0.0",
7676
"@solana/react": "^4.0.0",
77-
"@openzeppelin/contracts": "5.4.0",
7877
"@solana/wallet-adapter-base": "^0.9.27",
7978
"@solana/wallet-adapter-coinbase": "^0.1.23",
8079
"@solana/wallet-adapter-react": "^0.15.39",
8180
"@solana/wallet-adapter-react-ui": "^0.9.39",
8281
"@solana/wallet-adapter-solflare": "^0.6.32",
8382
"@solana/wallet-adapter-trust": "^0.1.17",
84-
"@solana/wallet-adapter-wallets": "^0.19.37",
8583
"@supabase/supabase-js": "^2.75.1",
84+
"astro": "^5.14.6",
8685
"bignumber.js": "^9.3.1",
8786
"bs58": "^6.0.0",
8887
"clipboard": "^2.0.11",
@@ -107,6 +106,7 @@
107106
},
108107
"devDependencies": {
109108
"@apidevtools/swagger-parser": "^10.1.1",
109+
"solhint-plugin-chainlink-solidity": "github:smartcontractkit/chainlink-solhint-rules#v1.3.0",
110110
"@jest/globals": "^29.7.0",
111111
"@project-serum/anchor": "^0.26.0",
112112
"@rollup/plugin-yaml": "^4.1.2",
@@ -137,8 +137,7 @@
137137
"prettier": "^3.5.3",
138138
"prettier-plugin-astro": "^0.14.1",
139139
"solhint": "^6.0.1",
140-
"solhint-plugin-chainlink-solidity": "github:smartcontractkit/chainlink-solhint-rules#v1.2.1",
141-
"ts-jest": "^29.4.4",
140+
"ts-jest": "^29.4.5",
142141
"tsconfig-paths": "^4.2.0",
143142
"tsx": "^4.20.6",
144143
"typescript": "^5.9.3",

public/samples/APIRequests/APIConsumer.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ contract APIConsumer is ChainlinkClient, ConfirmedOwner {
7575
/**
7676
* Receive the response in the form of uint256
7777
*/
78-
function fulfill(bytes32 _requestId, uint256 _volume) public recordChainlinkFulfillment(_requestId) {
78+
function fulfill(
79+
bytes32 _requestId,
80+
uint256 _volume
81+
) public recordChainlinkFulfillment(_requestId) {
7982
emit RequestVolume(_requestId, _volume);
8083
volume = _volume;
8184
}

public/samples/APIRequests/APIConsumerForwarder.sol

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ contract APIConsumerForwarder is ChainlinkClient, ConfirmedOwner {
2828
_setChainlinkToken(0x779877A7B0D9E8603169DdbD7836e478b4624789);
2929
}
3030

31-
function requestEthereumPrice(address _oracle, string memory _jobId) public onlyOwner {
31+
function requestEthereumPrice(
32+
address _oracle,
33+
string memory _jobId
34+
) public onlyOwner {
3235
Chainlink.Request memory req =
3336
_buildChainlinkRequest(stringToBytes32(_jobId), address(this), this.fulfillEthereumPrice.selector);
3437
req._add("get", "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD");
@@ -41,7 +44,10 @@ contract APIConsumerForwarder is ChainlinkClient, ConfirmedOwner {
4144
* Create a Chainlink request to retrieve API response, find the target
4245
* data which is located in a list
4346
*/
44-
function requestFirstId(address _oracle, string memory _jobId) public onlyOwner {
47+
function requestFirstId(
48+
address _oracle,
49+
string memory _jobId
50+
) public onlyOwner {
4551
Chainlink.Request memory req =
4652
_buildChainlinkRequest(stringToBytes32(_jobId), address(this), this.fulfillFirstId.selector);
4753

@@ -60,19 +66,25 @@ contract APIConsumerForwarder is ChainlinkClient, ConfirmedOwner {
6066
// .. }]
6167
// request.add("path", "0.id"); // Chainlink nodes prior to 1.0.0 support this format
6268
req._add("path", "0,id"); // Chainlink nodes 1.0.0 and later support this format
63-
// Sends the request
69+
// Sends the request
6470
_sendChainlinkRequestTo(_oracle, req, ORACLE_PAYMENT);
6571
}
6672

67-
function fulfillEthereumPrice(bytes32 _requestId, uint256 _price) public recordChainlinkFulfillment(_requestId) {
73+
function fulfillEthereumPrice(
74+
bytes32 _requestId,
75+
uint256 _price
76+
) public recordChainlinkFulfillment(_requestId) {
6877
emit RequestEthereumPriceFulfilled(_requestId, _price);
6978
currentPrice = _price;
7079
}
7180

7281
/**
7382
* Receive the response in the form of string
7483
*/
75-
function fulfillFirstId(bytes32 _requestId, string memory _id) public recordChainlinkFulfillment(_requestId) {
84+
function fulfillFirstId(
85+
bytes32 _requestId,
86+
string memory _id
87+
) public recordChainlinkFulfillment(_requestId) {
7688
emit RequestFirstId(_requestId, _id);
7789
id = _id;
7890
}

public/samples/APIRequests/ATestnetConsumer.sol

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ contract ATestnetConsumer is ChainlinkClient, ConfirmedOwner {
2626
_setChainlinkToken(0x779877A7B0D9E8603169DdbD7836e478b4624789);
2727
}
2828

29-
function requestEthereumPrice(address _oracle, string memory _jobId) public onlyOwner {
29+
function requestEthereumPrice(
30+
address _oracle,
31+
string memory _jobId
32+
) public onlyOwner {
3033
Chainlink.Request memory req =
3134
_buildChainlinkRequest(stringToBytes32(_jobId), address(this), this.fulfillEthereumPrice.selector);
3235
req._add("get", "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD");
@@ -35,7 +38,10 @@ contract ATestnetConsumer is ChainlinkClient, ConfirmedOwner {
3538
_sendChainlinkRequestTo(_oracle, req, ORACLE_PAYMENT);
3639
}
3740

38-
function fulfillEthereumPrice(bytes32 _requestId, uint256 _price) public recordChainlinkFulfillment(_requestId) {
41+
function fulfillEthereumPrice(
42+
bytes32 _requestId,
43+
uint256 _price
44+
) public recordChainlinkFulfillment(_requestId) {
3945
emit RequestEthereumPriceFulfilled(_requestId, _price);
4046
currentPrice = _price;
4147
}

public/samples/APIRequests/FetchFromArray.sol

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@ contract FetchFromArray is ChainlinkClient, ConfirmedOwner {
6464
// .. }]
6565
// request.add("path", "0.id"); // Chainlink nodes prior to 1.0.0 support this format
6666
req._add("path", "0,id"); // Chainlink nodes 1.0.0 and later support this format
67-
// Sends the request
67+
// Sends the request
6868
return _sendChainlinkRequest(req, fee);
6969
}
7070

7171
/**
7272
* Receive the response in the form of string
7373
*/
74-
function fulfill(bytes32 _requestId, string memory _id) public recordChainlinkFulfillment(_requestId) {
74+
function fulfill(
75+
bytes32 _requestId,
76+
string memory _id
77+
) public recordChainlinkFulfillment(_requestId) {
7578
emit RequestFirstId(_requestId, _id);
7679
id = _id;
7780
}

public/samples/APIRequests/GenericBigWord.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ contract GenericLargeResponse is ChainlinkClient, ConfirmedOwner {
6262
* @notice Fulfillment function for variable bytes
6363
* @dev This is called by the oracle. recordChainlinkFulfillment must be used.
6464
*/
65-
function fulfillBytes(bytes32 requestId, bytes memory bytesData) public recordChainlinkFulfillment(requestId) {
65+
function fulfillBytes(
66+
bytes32 requestId,
67+
bytes memory bytesData
68+
) public recordChainlinkFulfillment(requestId) {
6669
emit RequestFulfilled(requestId, bytesData);
6770
data = bytesData;
6871
image_url = string(data);

public/samples/Automation/AutomationCounter.sol

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@ contract Counter is AutomationCompatibleInterface {
3939

4040
function checkUpkeep(
4141
bytes calldata /* checkData */
42-
) external view override returns (bool upkeepNeeded, bytes memory /* performData */ ) {
42+
)
43+
external
44+
view
45+
override
46+
returns (
47+
bool upkeepNeeded,
48+
bytes memory /* performData */
49+
)
50+
{
4351
upkeepNeeded = (block.timestamp - lastTimeStamp) > interval;
4452
// We don't use the checkData in this example. The checkData is defined when the Upkeep was registered.
4553
}

public/samples/Automation/BalancerOffChain.sol

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.20;
33

4-
import {AutomationCompatibleInterface} from
5-
"@chainlink/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol";
4+
import {
5+
AutomationCompatibleInterface
6+
} from "@chainlink/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol";
67

78
/**
89
* @dev Example contract which perform most of the computation in `checkUpkeep`
@@ -36,7 +37,10 @@ contract BalancerOffChain is AutomationCompatibleInterface {
3637
}
3738

3839
/// @dev withdraw an `amount`from multiple elements of the `balances` array. The elements are provided in `indexes`
39-
function withdraw(uint256 amount, uint256[] memory indexes) public {
40+
function withdraw(
41+
uint256 amount,
42+
uint256[] memory indexes
43+
) public {
4044
for (uint256 i = 0; i < indexes.length; i++) {
4145
require(indexes[i] < SIZE, "Provided index out of bound");
4246
balances[indexes[i]] -= amount;

public/samples/Automation/BalancerOnChain.sol

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.20;
33

4-
import {AutomationCompatibleInterface} from
5-
"@chainlink/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol";
4+
import {
5+
AutomationCompatibleInterface
6+
} from "@chainlink/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol";
67

78
/**
89
* @dev Example contract which perform all the computation in `performUpkeep`
@@ -35,7 +36,10 @@ contract BalancerOnChain is AutomationCompatibleInterface {
3536
}
3637

3738
/// @dev withdraw an `amount`from multiple elements of `balances` array. The elements are provided in `indexes`
38-
function withdraw(uint256 amount, uint256[] memory indexes) public {
39+
function withdraw(
40+
uint256 amount,
41+
uint256[] memory indexes
42+
) public {
3943
for (uint256 i = 0; i < indexes.length; i++) {
4044
require(indexes[i] < SIZE, "Provided index out of bound");
4145
balances[indexes[i]] -= amount;

0 commit comments

Comments
 (0)