Skip to content

Commit c1b582d

Browse files
committed
format sol files
1 parent 08b2c21 commit c1b582d

Some content is hidden

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

49 files changed

+1286
-2553
lines changed

package-lock.json

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

public/samples/APIRequests/APIConsumer.sol

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

public/samples/APIRequests/APIConsumerForwarder.sol

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

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

@@ -70,21 +64,15 @@ contract APIConsumerForwarder is ChainlinkClient, ConfirmedOwner {
7064
_sendChainlinkRequestTo(_oracle, req, ORACLE_PAYMENT);
7165
}
7266

73-
function fulfillEthereumPrice(
74-
bytes32 _requestId,
75-
uint256 _price
76-
) public recordChainlinkFulfillment(_requestId) {
67+
function fulfillEthereumPrice(bytes32 _requestId, uint256 _price) public recordChainlinkFulfillment(_requestId) {
7768
emit RequestEthereumPriceFulfilled(_requestId, _price);
7869
currentPrice = _price;
7970
}
8071

8172
/**
8273
* Receive the response in the form of string
8374
*/
84-
function fulfillFirstId(
85-
bytes32 _requestId,
86-
string memory _id
87-
) public recordChainlinkFulfillment(_requestId) {
75+
function fulfillFirstId(bytes32 _requestId, string memory _id) public recordChainlinkFulfillment(_requestId) {
8876
emit RequestFirstId(_requestId, _id);
8977
id = _id;
9078
}

public/samples/APIRequests/ATestnetConsumer.sol

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

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

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

public/samples/APIRequests/FetchFromArray.sol

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,7 @@ contract FetchFromArray is ChainlinkClient, ConfirmedOwner {
7171
/**
7272
* Receive the response in the form of string
7373
*/
74-
function fulfill(
75-
bytes32 _requestId,
76-
string memory _id
77-
) public recordChainlinkFulfillment(_requestId) {
74+
function fulfill(bytes32 _requestId, string memory _id) public recordChainlinkFulfillment(_requestId) {
7875
emit RequestFirstId(_requestId, _id);
7976
id = _id;
8077
}

public/samples/APIRequests/GenericBigWord.sol

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ 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(
66-
bytes32 requestId,
67-
bytes memory bytesData
68-
) public recordChainlinkFulfillment(requestId) {
65+
function fulfillBytes(bytes32 requestId, bytes memory bytesData) public recordChainlinkFulfillment(requestId) {
6966
emit RequestFulfilled(requestId, bytesData);
7067
data = bytesData;
7168
image_url = string(data);

public/samples/Automation/AutomationCounter.sol

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

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

public/samples/Automation/BalancerOffChain.sol

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

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

87
/**
98
* @dev Example contract which perform most of the computation in `checkUpkeep`
@@ -37,10 +36,7 @@ contract BalancerOffChain is AutomationCompatibleInterface {
3736
}
3837

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

public/samples/Automation/BalancerOnChain.sol

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

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

87
/**
98
* @dev Example contract which perform all the computation in `performUpkeep`
@@ -36,10 +35,7 @@ contract BalancerOnChain is AutomationCompatibleInterface {
3635
}
3736

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

public/samples/Automation/CountWithLog.sol

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ contract CountWithLog is ILogAutomation {
3030

3131
constructor() {}
3232

33-
function checkLog(
34-
Log calldata log,
35-
bytes memory
36-
) external pure returns (bool upkeepNeeded, bytes memory performData) {
33+
function checkLog(Log calldata log, bytes memory) external pure returns (bool upkeepNeeded, bytes memory performData) {
3734
upkeepNeeded = true;
3835
address logSender = bytes32ToAddress(log.topics[1]);
3936
performData = abi.encode(logSender);

0 commit comments

Comments
 (0)