Skip to content

Commit cf60c94

Browse files
committed
Released version 0.1.37
1 parent 6f162e0 commit cf60c94

File tree

606 files changed

+17095
-9643
lines changed

Some content is hidden

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

606 files changed

+17095
-9643
lines changed

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
node_modules
2-
dist
1+
# Ignores macOS stuff
32
.DS_Store
3+
.LSOverride
4+
5+
# Ignores npm dependencies
6+
node_modules/
7+
yarn.lock

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,13 @@ Very simple contract that can consume the FTSO prices is shown in `examples/netw
8080
An example usage of the FTSO system to dynamically price token in a contract is showcased in
8181
`examples/network/DynamicToken.sol` with a more detailed explanation in the [blogpost](https://medium.com/@j0-0sko/taking-it-up-to-11-74dd91c39c2b).
8282

83-
8483
### I want to confirm something using the attestation client
8584

8685
Coming soon.
8786

88-
------
87+
---
8988

90-
**You've got the tools, turn on your imagination and go, go and build something awesome**
89+
**You've got the tools, turn on your imagination and go, go and build something awesome!**
9190

9291
If you find any mistake or have any suggestions, please open an issue or contact us are directly.
9392

coston/ContractRegistry.sol

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// SPDX-License-Identifier: MIT
2-
pragma solidity ^0.8.0;
2+
pragma solidity ^0.8.25;
33

44
import {IFlareContractRegistry} from "./IFlareContractRegistry.sol";
5-
6-
// Auto generated imports
75
// AUTO GENERATED - DO NOT EDIT BELOW THIS LINE
86
import {IPriceSubmitter} from "./IPriceSubmitter.sol";
97
import {IGovernanceSettings} from "./IGovernanceSettings.sol";
@@ -42,8 +40,8 @@ import {IFdcVerification} from "./IFdcVerification.sol";
4240
import {IFdcHub} from "./IFdcHub.sol";
4341
import {IFdcRequestFeeConfigurations} from "./IFdcRequestFeeConfigurations.sol";
4442
import {IAssetManagerController} from "./IAssetManagerController.sol";
43+
import {IAssetManager} from "./IAssetManager.sol";
4544
import {IJsonApiVerification} from "./IJsonApiVerification.sol";
46-
import {IWeb2JsonVerification} from "./IWeb2JsonVerification.sol";
4745
// END AUTO GENERATED - DO NOT EDIT ABOVE THIS LINE
4846

4947
// Library is intended to be used inline, so the strings are all memory allocated (instead of calldata)
@@ -496,7 +494,15 @@ library ContractRegistry {
496494
);
497495
}
498496

499-
// Returns hardcoded unofficial deployment instances of Flare core contracts
497+
function getAssetManagerFXRP() internal view returns (IAssetManager) {
498+
return
499+
IAssetManager(
500+
FLARE_CONTRACT_REGISTRY.getContractAddressByHash(
501+
keccak256(abi.encode("AssetManagerFXRP"))
502+
)
503+
);
504+
}
505+
500506
function auxiliaryGetIJsonApiVerification()
501507
internal
502508
pure
@@ -505,15 +511,5 @@ library ContractRegistry {
505511
return IJsonApiVerification(0x206D83e3a24523De1E43Ab56AC8f7b9b10f6ab89);
506512
}
507513

508-
// Returns hardcoded unofficial deployment instances of Flare core contracts
509-
function auxiliaryGetIWeb2JsonVerification()
510-
internal
511-
pure
512-
returns (IWeb2JsonVerification)
513-
{
514-
return
515-
IWeb2JsonVerification(0x30DAB57c409E1e18c8B00dC351Bf568953D607B1);
516-
}
517-
518514
// END AUTO GENERATED - DO NOT EDIT ABOVE THIS LINE
519515
}

coston/FtsoV2Interface.sol

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pragma solidity >=0.7.6 <0.9;
55
* FtsoV2 long term support interface.
66
*/
77
interface FtsoV2Interface {
8-
98
/// Feed data structure
109
struct FeedData {
1110
uint32 votingRoundId;
@@ -40,27 +39,37 @@ interface FtsoV2Interface {
4039
* To get the list of all available feed ids, combine with `getFeedIdChanges()`.
4140
* @return _feedIds The list of supported feed ids.
4241
*/
43-
function getSupportedFeedIds() external view returns (bytes21[] memory _feedIds);
42+
function getSupportedFeedIds()
43+
external
44+
view
45+
returns (bytes21[] memory _feedIds);
4446

4547
/**
4648
* Returns the list of feed id changes.
4749
* @return _feedIdChanges The list of changed feed id pairs (old and new feed id).
4850
*/
49-
function getFeedIdChanges() external view returns (FeedIdChange[] memory _feedIdChanges);
51+
function getFeedIdChanges()
52+
external
53+
view
54+
returns (FeedIdChange[] memory _feedIdChanges);
5055

5156
/**
5257
* Calculates the fee for fetching a feed.
5358
* @param _feedId The id of the feed.
5459
* @return _fee The fee for fetching the feed.
5560
*/
56-
function calculateFeeById(bytes21 _feedId) external view returns (uint256 _fee);
61+
function calculateFeeById(
62+
bytes21 _feedId
63+
) external view returns (uint256 _fee);
5764

5865
/**
5966
* Calculates the fee for fetching feeds.
6067
* @param _feedIds The list of feed ids.
6168
* @return _fee The fee for fetching the feeds.
6269
*/
63-
function calculateFeeByIds(bytes21[] memory _feedIds) external view returns (uint256 _fee);
70+
function calculateFeeByIds(
71+
bytes21[] memory _feedIds
72+
) external view returns (uint256 _fee);
6473

6574
/**
6675
* Returns stored data of a feed.
@@ -70,13 +79,12 @@ interface FtsoV2Interface {
7079
* @return _decimals The decimal places for the requested feed.
7180
* @return _timestamp The timestamp of the last update.
7281
*/
73-
function getFeedById(bytes21 _feedId)
74-
external payable
75-
returns (
76-
uint256 _value,
77-
int8 _decimals,
78-
uint64 _timestamp
79-
);
82+
function getFeedById(
83+
bytes21 _feedId
84+
)
85+
external
86+
payable
87+
returns (uint256 _value, int8 _decimals, uint64 _timestamp);
8088

8189
/**
8290
* Returns stored data of each feed.
@@ -86,8 +94,11 @@ interface FtsoV2Interface {
8694
* @return _decimals The list of decimal places for the requested feeds.
8795
* @return _timestamp The timestamp of the last update.
8896
*/
89-
function getFeedsById(bytes21[] memory _feedIds)
90-
external payable
97+
function getFeedsById(
98+
bytes21[] memory _feedIds
99+
)
100+
external
101+
payable
91102
returns (
92103
uint256[] memory _values,
93104
int8[] memory _decimals,
@@ -101,30 +112,26 @@ interface FtsoV2Interface {
101112
* @return _value The value for the requested feed in wei (i.e. with 18 decimal places).
102113
* @return _timestamp The timestamp of the last update.
103114
*/
104-
function getFeedByIdInWei(bytes21 _feedId)
105-
external payable
106-
returns (
107-
uint256 _value,
108-
uint64 _timestamp
109-
);
115+
function getFeedByIdInWei(
116+
bytes21 _feedId
117+
) external payable returns (uint256 _value, uint64 _timestamp);
110118

111119
/** Returns value of each feed and a timestamp.
112120
* For some feeds, a fee (calculated by the FeeCalculator contract) may need to be paid.
113121
* @param _feedIds Ids of the feeds.
114122
* @return _values The list of values for the requested feeds in wei (i.e. with 18 decimal places).
115123
* @return _timestamp The timestamp of the last update.
116124
*/
117-
function getFeedsByIdInWei(bytes21[] memory _feedIds)
118-
external payable
119-
returns (
120-
uint256[] memory _values,
121-
uint64 _timestamp
122-
);
125+
function getFeedsByIdInWei(
126+
bytes21[] memory _feedIds
127+
) external payable returns (uint256[] memory _values, uint64 _timestamp);
123128

124129
/**
125130
* Checks if the feed data is valid (i.e. is part of the confirmed Merkle tree).
126131
* @param _feedData Structure containing data about the feed (FeedData structure) and Merkle proof.
127132
* @return true if the feed data is valid.
128133
*/
129-
function verifyFeedData(FeedDataWithProof calldata _feedData) external view returns (bool);
134+
function verifyFeedData(
135+
FeedDataWithProof calldata _feedData
136+
) external view returns (bool);
130137
}

coston/IAddressValidityVerification.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pragma solidity >=0.7.6 <0.9;
44
import "./IAddressValidity.sol";
55

66
interface IAddressValidityVerification {
7-
8-
function verifyAddressValidity(IAddressValidity.Proof calldata _proof)
9-
external view returns (bool _proved);
7+
function verifyAddressValidity(
8+
IAddressValidity.Proof calldata _proof
9+
) external view returns (bool _proved);
1010
}
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity >=0.7.6 <0.9;
33

4-
54
interface IAgentAlwaysAllowedMinters {
6-
function addAlwaysAllowedMinterForAgent(address _agentVault, address _minter)
7-
external;
5+
function addAlwaysAllowedMinterForAgent(
6+
address _agentVault,
7+
address _minter
8+
) external;
89

9-
function removeAlwaysAllowedMinterForAgent(address _agentVault, address _minter)
10-
external;
10+
function removeAlwaysAllowedMinterForAgent(
11+
address _agentVault,
12+
address _minter
13+
) external;
1114

12-
function alwaysAllowedMintersForAgent(address _agentVault)
13-
external view
14-
returns (address[] memory);
15+
function alwaysAllowedMintersForAgent(
16+
address _agentVault
17+
) external view returns (address[] memory);
1518
}

coston/IAgentOwnerRegistry.sol

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.7.6 <0.9;
3+
pragma abicoder v2;
4+
5+
/**
6+
* Agent owner management and work address management
7+
*/
8+
interface IAgentOwnerRegistry {
9+
event Whitelisted(address value);
10+
event WhitelistingRevoked(address value);
11+
12+
/**
13+
* Agent owner's work address has been set.
14+
*/
15+
event WorkAddressChanged(
16+
address indexed managementAddress,
17+
address prevWorkAddress,
18+
address workAddress
19+
);
20+
21+
event AgentDataChanged(
22+
address indexed managementAddress,
23+
string name,
24+
string description,
25+
string iconUrl,
26+
string termsOfUseUrl
27+
);
28+
29+
error AgentNotWhitelisted();
30+
error WorkAddressInUse();
31+
32+
/**
33+
* Returns true if the address is whitelisted, false otherwise.
34+
* @param _address address to check
35+
*/
36+
function isWhitelisted(address _address) external view returns (bool);
37+
38+
/**
39+
* Return agent owner's name.
40+
* @param _managementAddress agent owner's management address
41+
*/
42+
function getAgentName(
43+
address _managementAddress
44+
) external view returns (string memory);
45+
46+
/**
47+
* Return agent owner's description.
48+
* @param _managementAddress agent owner's management address
49+
*/
50+
function getAgentDescription(
51+
address _managementAddress
52+
) external view returns (string memory);
53+
54+
/**
55+
* Return url of the agent owner's icon.
56+
* @param _managementAddress agent owner's management address
57+
*/
58+
function getAgentIconUrl(
59+
address _managementAddress
60+
) external view returns (string memory);
61+
62+
/**
63+
* Return url of the agent's page with terms of use.
64+
* @param _managementAddress agent owner's management address
65+
*/
66+
function getAgentTermsOfUseUrl(
67+
address _managementAddress
68+
) external view returns (string memory);
69+
70+
/**
71+
* Get the (unique) work address for the given management address.
72+
*/
73+
function getWorkAddress(
74+
address _managementAddress
75+
) external view returns (address);
76+
77+
/**
78+
* Get the (unique) management address for the given work address.
79+
*/
80+
function getManagementAddress(
81+
address _workAddress
82+
) external view returns (address);
83+
}

coston/IAgentPing.sol

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ interface IAgentPing {
1111
event AgentPing(
1212
address indexed agentVault,
1313
address indexed sender,
14-
uint256 query);
14+
uint256 query
15+
);
1516

1617
/**
1718
* Response to agent bot liveness check.
@@ -24,17 +25,15 @@ interface IAgentPing {
2425
address indexed agentVault,
2526
address indexed owner,
2627
uint256 query,
27-
string response);
28+
string response
29+
);
2830

2931
/**
3032
* Used for liveness checks, simply emits AgentPing event.
3133
* @param _agentVault the agent vault whose owner bot to ping
3234
* @param _query off-chain defined id of the query
3335
*/
34-
function agentPing(
35-
address _agentVault,
36-
uint256 _query
37-
) external;
36+
function agentPing(address _agentVault, uint256 _query) external;
3837

3938
/**
4039
* Used for liveness checks, the bot's response to AgentPing event.

0 commit comments

Comments
 (0)