Skip to content

Commit 3b67923

Browse files
committed
format sol files
1 parent c1b582d commit 3b67923

File tree

58 files changed

+523
-167
lines changed

Some content is hidden

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

58 files changed

+523
-167
lines changed

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: 16 additions & 4 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

@@ -64,15 +70,21 @@ contract APIConsumerForwarder is ChainlinkClient, ConfirmedOwner {
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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ contract FetchFromArray is ChainlinkClient, ConfirmedOwner {
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;

public/samples/Automation/CountWithLog.sol

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

3131
constructor() {}
3232

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

public/samples/Automation/CounterwForwarder.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ pragma solidity ^0.8.20;
1212
* THIS IS AN EXAMPLE CONTRACT THAT USES UN-AUDITED CODE.
1313
* DO NOT USE THIS CODE IN PRODUCTION.
1414
*/
15-
import {AutomationCompatibleInterface} from
16-
"@chainlink/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol";
15+
import {
16+
AutomationCompatibleInterface
17+
} from "@chainlink/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol";
1718
import {OwnerIsCreator} from "@chainlink/contracts/src/v0.8/shared/access/OwnerIsCreator.sol";
1819

1920
contract CounterwForwarder is AutomationCompatibleInterface, OwnerIsCreator {

0 commit comments

Comments
 (0)