BridgeSHIB
Link to BridgeETH source code on Shibarium
BridgeSHIB contract is the Shibarium part of the K9-owned bridge. This bridge is used only by K9 Finance DAO for the platform purposes to transfer knBONE tokens from Shibarium to Ethereum 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 ACCEPTOR_ROLE = keccak256("ACCEPTOR_ROLE"); - role identifier of the recipient of the transaction
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 leaving this network
IKnBONESHIB knBONE; - knBONE contract interface
mapping(uint256 => bool) public acceptedSignature; - for each nonce of an outgoing transaction, it shows whether it was accepted or not, this is necessary as protection against signature replay of transaction receivers
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 amountToReceive, uint256 feeAmount, uint256 _instantPoolAmount, uint256 _requestWithdrawAmount); - upon depositForUserOrUnstake call (when user submits or unstakes)
event Execute(uint256 indexed chainID, uint256 indexed transactionID); - upon execute call (processing an incoming transaction)
Methods
initialize
function initialize(
address _dao,
IKnBONESHIB _knBONE,
address _acceptor,
address[] calldata _validators,
uint256 _minSignatures)
external
initializerInitializer function, not called after initialization.
depositForUserOrUnstake
Allows the user to transfer tokens from Shibarium to Ethereum or transfer and unstake.
If transfer and unstake, the receiver must match the sender of the transaction.
The transaction receiver signature is required.
execute
Executes a transaction from the origin network.
It is necessary that there are at least minimum minSignatures signatures from unique addresses having VALIDATOR_ROLE in the signatures array.
setMinSignatures
Sets minSignatures, cannot be set to 0.
pause
Pauses the BridgeSHIB contract.
unpause
Unpauses the BridgeSHIB contract.
Last updated