BridgeETH
Link to BridgeETH source code on Ethereum
BridgeETH contract is the Ethereum part of the K9-owned bridge. This bridge is used only by K9 Finance DAO for the platform purposes to transfer knBONE tokens from Ethereum to Shibarium and backwards.
Variables
bytes32 public constant DAO_ROLE = keccak256("DAO_ROLE");
- dao role identifier
bytes32 public constant VALIDATOR_ROLE = keccak256("VALIDATOR_ROLE");
- bridge validator role identifier
bytes32 public constant PAUSE_ROLE = keccak256("PAUSE_ROLE");
- pauser role identifier
bytes32 public constant UNPAUSE_ROLE = keccak256("UNPAUSE_ROLE");
- unpauser role identifier
uint256 public minSignatures;
- minimum number of signatures from validators to accept a transaction
uint256 public nextTransactionIDFromThisNetwork;
- the next transactionID that will be assigned to a transaction of this network
IKnBONE public knBONE
- knBONE contract interface
address public feeReceiver;
- bridging fee receiver address
mapping(uint256 => mapping(uint256 => bool)) public processedTransaction;
- for each network, for each in
and out
transaction , it shows whether it was processed or not
Events
event Deposit(uint256 indexed transactionID, address indexed from, address indexed to, uint256 amount);
- upon depositForUser call (when user submits)
event Execute(uint256 indexed chainID, uint256 indexed transactionID, uint8 indexed withdrawStatus);
- upon execute call (processing an incoming transaction)
Methods
initialize
Initializer function, not called after initialization
depositForUser
When user have done the deposit to protocol, claims the knBONE amount of the associated deposit to further transfer it from Ethereum to Shibarium.
execute
Processes the incoming transaction of deposit or withdrawal.
If the _instantPoolAmount
or/and _requestWithdrawAmount
values are not zero, then it means that user wants to unstake from the protocol, so this function tries to unstake from knBONE contract with the specified parameters on behalf of the receiver. If zero, then user's deposit is processed.
It is necessary that there are at least minimum minSignatures signatures from unique addresses having VALIDATOR_ROLE in the signatures array.
simulateExecute
Does the same as execute()
only without signatures - needed for simulation to check if the execute()
will work on user call. Any chainID and transactionID may be specified.
Available only when the sender is a zero address.
setMinSignatures
Sets minSignatures, cannot be set to 0.
setFeeReceiver
Sets feeReceiver, cannot be set to 0 address.
pause
Pauses the BridgeETH contract.
unpause
Unpauses the BridgeETH contract.
Last updated