Skip to content

Commit

Permalink
replace evm.origin with sender address
Browse files Browse the repository at this point in the history
  • Loading branch information
trestinlsd committed Sep 5, 2024
1 parent 8b2a247 commit 85d4b48
Show file tree
Hide file tree
Showing 9 changed files with 212 additions and 115 deletions.
16 changes: 16 additions & 0 deletions precompiles/avs/IAVSManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ IAVSManager constant AVSMANAGER_CONTRACT = IAVSManager(
/// @custom:address 0x0000000000000000000000000000000000000901
interface IAVSManager {
/// @dev Register AVS contract to EXO.
/// @param sender The external address for calling this method.
/// @param avsName The name of AVS.
/// @param minStakeAmount The minimum amount of funds staked by each operator.
/// @param taskAddr The task address of AVS.
Expand All @@ -29,6 +30,7 @@ interface IAVSManager {
///3.avsReward The proportion of reward for AVS.
///4.avsSlash The proportion of slash for AVS.
function registerAVS(
address sender,
string memory avsName,
uint64 minStakeAmount,
address taskAddr,
Expand All @@ -43,6 +45,7 @@ interface IAVSManager {
) external returns (bool success);

/// @dev Update AVS info to EXO.
/// @param sender The external address for calling this method.
/// @param avsName The name of AVS.
/// @param minStakeAmount The minimum amount of funds staked by each operator.
/// @param taskAddr The task address of AVS.
Expand All @@ -58,6 +61,7 @@ interface IAVSManager {
///3.avsReward The proportion of reward for AVS.
///4.avsSlash The proportion of slash for AVS.
function updateAVS(
address sender,
string memory avsName,
uint64 minStakeAmount,
address taskAddr,
Expand All @@ -72,28 +76,36 @@ interface IAVSManager {
) external returns (bool success);

/// @dev Deregister avs from exo
/// @param sender The external address for calling this method.
/// @param avsName The name of AVS.
function deregisterAVS(
address sender,
string memory avsName
) external returns (bool success);

/// @dev RegisterOperatorToAVS operator opt in current avs
/// @param sender The external address for calling this method.
function registerOperatorToAVS(
address sender
) external returns (bool success);

/// @dev DeregisterOperatorFromAVS operator opt out current avs
/// @param sender The external address for calling this method.
function deregisterOperatorFromAVS(
address sender
) external returns (bool success);


/// @dev CreateTask , avs owner create a new task
/// @param sender The external address for calling this method.
/// @param name The name of the task.
/// @param hash The data supplied by the contract, usually ABI-encoded.
/// @param taskResponsePeriod The deadline for task response.
/// @param taskChallengePeriod The challenge period for the task.
/// @param thresholdPercentage The signature threshold percentage.
/// @param taskStatisticalPeriod The statistical period for the task.
function createTask(
address sender,
string memory name,
bytes calldata hash,
uint64 taskResponsePeriod,
Expand All @@ -103,11 +115,13 @@ interface IAVSManager {
) external returns (bool success);

/// @dev challenge , this function enables a challenger to raise and resolve a challenge.
/// @param sender The external address for calling this method.
/// @param taskHash The data supplied by the contract, usually ABI-encoded.
/// @param taskID The id of task.
/// @param taskResponseHash The hash of task response.
/// @param operatorAddress operator address.
function challenge(
address sender,
bytes calldata taskHash,
uint64 taskID,
bytes calldata taskResponseHash,
Expand All @@ -132,11 +146,13 @@ interface IAVSManager {


/// @dev Called by the avs manager service register an operator as the owner of a BLS public key.
/// @param sender The external address for calling this method.
/// @param name the name of public keys
/// @param pubKey the public keys of the operator
/// @param pubkeyRegistrationSignature the public keys of the operator
/// @param pubkeyRegistrationMessageHash the public keys of the operator
function registerBLSPublicKey(
address sender,
string calldata name,
bytes calldata pubKey,
bytes calldata pubkeyRegistrationSignature,
Expand Down
49 changes: 38 additions & 11 deletions precompiles/avs/abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,6 @@
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "string",
"name": "operator",
"type": "string"
},
{
"indexed": false,
"internalType": "string",
Expand Down Expand Up @@ -345,6 +339,11 @@
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "bytes",
"name": "taskHash",
Expand Down Expand Up @@ -379,6 +378,11 @@
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "string",
"name": "name",
Expand Down Expand Up @@ -423,6 +427,11 @@
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "string",
"name": "avsName",
Expand All @@ -442,7 +451,11 @@
},
{
"inputs": [

{
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "deregisterOperatorFromAVS",
"outputs": [
Expand Down Expand Up @@ -538,6 +551,11 @@
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "string",
"name": "avsName",
Expand Down Expand Up @@ -608,9 +626,9 @@
{
"inputs": [
{
"internalType": "string",
"name": "operator",
"type": "string"
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "string",
Expand Down Expand Up @@ -646,7 +664,11 @@
},
{
"inputs": [

{
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "registerOperatorToAVS",
"outputs": [
Expand Down Expand Up @@ -700,6 +722,11 @@
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "string",
"name": "avsName",
Expand Down
Loading

0 comments on commit 85d4b48

Please sign in to comment.