Skip to content

Commit 75aedd6

Browse files
authored
Merge pull request #12 from flare-foundation/0.1.42
Update version to 0.1.42, add IMasterAccountController interface
2 parents 09c0b3d + a3f71ce commit 75aedd6

21 files changed

+1424
-49
lines changed

coston2/ContractRegistry.sol

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {IAssetManagerController} from "./IAssetManagerController.sol";
4343
import {IAssetManager} from "./IAssetManager.sol";
4444
import {IJsonApiVerification} from "./IJsonApiVerification.sol";
4545
import {IGenericRewardManager} from "./IGenericRewardManager.sol";
46+
import {IMasterAccountController} from "./IMasterAccountController.sol";
4647
// END AUTO GENERATED - DO NOT EDIT ABOVE THIS LINE
4748

4849
// Library is intended to be used inline, so the strings are all memory allocated (instead of calldata)
@@ -525,5 +526,18 @@ library ContractRegistry {
525526
);
526527
}
527528

529+
function getMasterAccountController()
530+
internal
531+
view
532+
returns (IMasterAccountController)
533+
{
534+
return
535+
IMasterAccountController(
536+
FLARE_CONTRACT_REGISTRY.getContractAddressByHash(
537+
keccak256(abi.encode("MasterAccountController"))
538+
)
539+
);
540+
}
541+
528542
// END AUTO GENERATED - DO NOT EDIT ABOVE THIS LINE
529543
}

flare/ContractRegistry.sol

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {IFdcRequestFeeConfigurations} from "./IFdcRequestFeeConfigurations.sol";
4242
import {IAssetManagerController} from "./IAssetManagerController.sol";
4343
import {IAssetManager} from "./IAssetManager.sol";
4444
import {IGenericRewardManager} from "./IGenericRewardManager.sol";
45+
import {IMasterAccountController} from "./IMasterAccountController.sol";
4546
// END AUTO GENERATED - DO NOT EDIT ABOVE THIS LINE
4647

4748
// Library is intended to be used inline, so the strings are all memory allocated (instead of calldata)
@@ -516,5 +517,18 @@ library ContractRegistry {
516517
);
517518
}
518519

520+
function getMasterAccountController()
521+
internal
522+
view
523+
returns (IMasterAccountController)
524+
{
525+
return
526+
IMasterAccountController(
527+
FLARE_CONTRACT_REGISTRY.getContractAddressByHash(
528+
keccak256(abi.encode("MasterAccountController"))
529+
)
530+
);
531+
}
532+
519533
// END AUTO GENERATED - DO NOT EDIT ABOVE THIS LINE
520534
}

flare/IAgentVaultsFacet.sol

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.8.4 <0.9;
3+
4+
/**
5+
* @title IAgentVaultsFacet
6+
* @notice Interface for the AgentVaultsFacet contract.
7+
*/
8+
interface IAgentVaultsFacet {
9+
/**
10+
* @notice Emitted when an agent vault is added.
11+
* @param agentVaultId The agent vault ID.
12+
* @param agentVaultAddress The agent vault address.
13+
*/
14+
event AgentVaultAdded(
15+
uint256 indexed agentVaultId,
16+
address indexed agentVaultAddress
17+
);
18+
19+
/**
20+
* @notice Emitted when an agent vault is removed.
21+
* @param agentVaultId The agent vault ID.
22+
* @param agentVaultAddress The agent vault address.
23+
*/
24+
event AgentVaultRemoved(
25+
uint256 indexed agentVaultId,
26+
address indexed agentVaultAddress
27+
);
28+
29+
/**
30+
* @notice Reverts if array lengths do not match.
31+
*/
32+
error AgentsVaultsLengthsMismatch();
33+
34+
/**
35+
* @notice Reverts if the agent vault ID is zero.
36+
* @param index The index in the input array.
37+
*/
38+
error AgentVaultIdZero(uint256 index);
39+
40+
/**
41+
* @notice Reverts if the agent vault ID is already added.
42+
* @param agentVaultId The agent vault ID.
43+
*/
44+
error AgentVaultIdAlreadyAdded(uint256 agentVaultId);
45+
46+
/**
47+
* @notice Reverts if the agent vault address is zero.
48+
* @param index The index in the input array.
49+
*/
50+
error AgentVaultAddressZero(uint256 index);
51+
52+
/**
53+
* @notice Reverts if the agent vault address is already added.
54+
* @param agentVaultAddress The agent vault address.
55+
*/
56+
error AgentVaultAddressAlreadyAdded(address agentVaultAddress);
57+
58+
/**
59+
* @notice Reverts if the agent vault is invalid.
60+
* @param agentVaultId The agent vault ID.
61+
*/
62+
error InvalidAgentVault(uint256 agentVaultId);
63+
64+
/**
65+
* @notice Reverts if the agent is not available.
66+
* @param agentVault The agent vault address.
67+
*/
68+
error AgentNotAvailable(address agentVault);
69+
70+
/**
71+
* Returns the list of registered agent vault IDs and their corresponding addresses.
72+
* @return _agentVaultIds The list of registered agent vault IDs.
73+
* @return _agentVaultAddresses The list of registered agent vault addresses.
74+
*/
75+
function getAgentVaults()
76+
external
77+
view
78+
returns (
79+
uint256[] memory _agentVaultIds,
80+
address[] memory _agentVaultAddresses
81+
);
82+
}

flare/ICustomInstructionsFacet.sol

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.8.4 <0.9;
3+
4+
/**
5+
* @title ICustomInstructionsFacet
6+
* @notice Interface for the CustomInstructionsFacet contract.
7+
*/
8+
interface ICustomInstructionsFacet {
9+
/// @notice Struct containing custom call information
10+
struct CustomCall {
11+
/// @notice Target contract address
12+
address targetContract;
13+
/// @notice value (in wei) to send with the call
14+
uint256 value;
15+
/// @notice Call data
16+
bytes data;
17+
}
18+
19+
/**
20+
* @notice Emitted when a custom instruction is registered.
21+
* @param customInstructionHash The hash representing the registered instructions.
22+
*/
23+
event CustomInstructionRegistered(bytes32 indexed customInstructionHash);
24+
25+
/**
26+
* @notice Emitted when a custom instruction is already registered.
27+
* @param customInstructionHash The hash representing the already registered instructions.
28+
*/
29+
event CustomInstructionAlreadyRegistered(
30+
bytes32 indexed customInstructionHash
31+
);
32+
33+
/**
34+
* @notice Reverts if the custom instruction is empty (zero custom calls).
35+
*/
36+
error EmptyCustomInstruction();
37+
38+
/**
39+
* @notice Reverts if the target address of a custom call is zero.
40+
*/
41+
error TargetAddressZero();
42+
43+
/**
44+
* @notice Reverts if the target address of a custom call is not a contract.
45+
* @param target The target address.
46+
*/
47+
error TargetNotAContract(address target);
48+
49+
/**
50+
* @notice Register custom instruction and return the call hash.
51+
* @param _customInstruction Custom instruction (array of custom calls) to register.
52+
* @return _customInstructionHash The hash representing the registered custom instruction.
53+
*/
54+
function registerCustomInstruction(
55+
CustomCall[] memory _customInstruction
56+
) external returns (bytes32 _customInstructionHash);
57+
58+
/**
59+
* @notice Get a custom instruction for a given call hash.
60+
* @param _customInstructionHash The hash representing the custom instruction.
61+
* @return _customInstruction Custom instruction (array of custom calls) for the hash.
62+
*/
63+
function getCustomInstruction(
64+
bytes32 _customInstructionHash
65+
) external view returns (CustomCall[] memory _customInstruction);
66+
/**
67+
* @notice Get paginated custom instruction hashes.
68+
* @param _start The starting index.
69+
* @param _end The ending index.
70+
* @return _customInstructionHashes Array of custom instruction hashes for the requested page.
71+
* @return _totalLength The total number of custom instruction hashes.
72+
*/
73+
function getCustomInstructionHashes(
74+
uint256 _start,
75+
uint256 _end
76+
)
77+
external
78+
view
79+
returns (
80+
bytes32[] memory _customInstructionHashes,
81+
uint256 _totalLength
82+
);
83+
84+
/**
85+
* @notice Encode a custom instruction to get its call hash.
86+
* @param _customInstruction Custom instruction (array of custom calls) to encode.
87+
* @return _customInstructionHash The hash representing the custom instruction.
88+
*/
89+
function encodeCustomInstruction(
90+
CustomCall[] memory _customInstruction
91+
) external pure returns (bytes32 _customInstructionHash);
92+
}

flare/IExecutorsFacet.sol

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.8.4 <0.9;
3+
4+
/**
5+
* @title IExecutorsFacet
6+
* @notice Interface for the ExecutorsFacet contract.
7+
*/
8+
interface IExecutorsFacet {
9+
/**
10+
* @notice Emitted when the executor address is set.
11+
* @param executor The new executor address.
12+
*/
13+
event ExecutorSet(address executor);
14+
15+
/**
16+
* @notice Emitted when the executor fee is set.
17+
* @param executorFee The new executor fee.
18+
*/
19+
event ExecutorFeeSet(uint256 executorFee);
20+
21+
/**
22+
* @notice Reverts if the executor address is invalid.
23+
*/
24+
error InvalidExecutor();
25+
26+
/**
27+
* @notice Reverts if the executor fee is invalid.
28+
*/
29+
error InvalidExecutorFee();
30+
31+
/**
32+
* Returns the executor address and fee.
33+
* @return _executor The executor address.
34+
* @return _executorFee The executor fee (in wei).
35+
*/
36+
function getExecutorInfo()
37+
external
38+
view
39+
returns (address payable _executor, uint256 _executorFee);
40+
}

flare/IInstructionFeesFacet.sol

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.8.4 <0.9;
3+
4+
/**
5+
* @title IInstructionFeesFacet
6+
* @notice Interface for the InstructionFeesFacet contract.
7+
*/
8+
interface IInstructionFeesFacet {
9+
/**
10+
* @notice Emitted when the default instruction fee is set.
11+
* @param defaultInstructionFee The new default instruction fee.
12+
*/
13+
event DefaultInstructionFeeSet(uint256 defaultInstructionFee);
14+
15+
/**
16+
* @notice Emitted when an instruction-specific fee is set.
17+
* @param instructionId The instruction ID.
18+
* @param instructionFee The fee for the instruction.
19+
*/
20+
event InstructionFeeSet(
21+
uint256 indexed instructionId,
22+
uint256 instructionFee
23+
);
24+
25+
/**
26+
* @notice Emitted when an instruction-specific fee is removed.
27+
* @param instructionId The instruction ID.
28+
*/
29+
event InstructionFeeRemoved(uint256 indexed instructionId);
30+
31+
/**
32+
* @notice Reverts if array lengths do not match.
33+
*/
34+
error InstructionFeesLengthsMismatch();
35+
36+
/**
37+
* @notice Reverts if the instruction fee is invalid.
38+
* @param instructionId The instruction ID.
39+
*/
40+
error InvalidInstructionFee(uint256 instructionId);
41+
42+
/**
43+
* @notice Reverts if the instruction fee is not set.
44+
* @param instructionId The instruction ID.
45+
*/
46+
error InstructionFeeNotSet(uint256 instructionId);
47+
48+
/**
49+
* @notice Returns the default instruction fee.
50+
* @return The default instruction fee in underlying asset's smallest unit (e.g., drops for XRP).
51+
*/
52+
function getDefaultInstructionFee() external view returns (uint256);
53+
54+
/**
55+
* @notice Returns the instruction fee for a given instruction ID.
56+
* @param _instructionId The ID of the instruction.
57+
* @return The instruction fee in underlying asset's smallest unit (e.g., drops for XRP).
58+
*/
59+
function getInstructionFee(
60+
uint256 _instructionId
61+
) external view returns (uint256);
62+
}

0 commit comments

Comments
 (0)