-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
blockchain_integration/pi_network/features/pi-coin-value-setter/PiCoinValueSetter.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
pragma solidity ^0.8.0; | ||
|
||
contract PiCoinValueSetter { | ||
// Set the target value of Pi Coin | ||
uint256 public targetValue = 314159000000000000000; // $314.159 | ||
|
||
// Set the mainnet launch timestamp | ||
uint256 public mainnetLaunchTimestamp; | ||
|
||
// Event emitted when the mainnet is launched | ||
event MainnetLaunched(); | ||
|
||
// Function to set the value of Pi Coin when the mainnet is launched | ||
function setPiCoinValue() public { | ||
// Check if the mainnet has been launched | ||
require(mainnetLaunchTimestamp != 0, "Mainnet has not been launched"); | ||
|
||
// Set the value of Pi Coin to the target value | ||
PiCoin piCoin = PiCoin(address); | ||
piCoin.setValue(targetValue); | ||
|
||
// Emit the MainnetLaunched event | ||
emit MainnetLaunched(); | ||
} | ||
|
||
// Function to set the mainnet launch timestamp | ||
function setMainnetLaunchTimestamp(uint256 _timestamp) public { | ||
mainnetLaunchTimestamp = _timestamp; | ||
} | ||
} |