-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPenpieOFT.sol
48 lines (36 loc) · 1.14 KB
/
PenpieOFT.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: MIT
pragma solidity =0.8.19;
import "@layerzerolabs/solidity-examples/contracts/token/oft/v2/OFTV2.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
contract PenpieOFT is OFTV2, Pausable {
/* ============ State Variables ============ */
/* ============ Constructor ============ */
constructor(
address _endpoint,
uint256 _mintAmt
) OFTV2("Penpie Token", "PNP", 8, _endpoint) {
if (_mintAmt > 0) {
_mint(msg.sender, _mintAmt);
}
}
/* ============ External Functions ============ */
/* ============ Internal Functions ============ */
function _debitFrom(
address _from,
uint16 _dstChainId,
bytes32 _toAddress,
uint _amount
) internal override whenNotPaused returns (uint) {
return super._debitFrom(_from, _dstChainId, _toAddress, _amount);
}
function _creditTo(uint16 _srcChainId, address _toAddress, uint _amount) internal override whenNotPaused returns (uint) {
return super._creditTo(_srcChainId, _toAddress, _amount);
}
/* ============ Admin Functions ============ */
function pause() public onlyOwner {
_pause();
}
function unpause() public onlyOwner {
_unpause();
}
}