- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control. - Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities. - Created .gitmodules to include OpenZeppelin contracts as a submodule. - Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment. - Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks. - Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring. - Created scripts for resource import and usage validation across non-US regions. - Added tests for CCIP error handling and integration to ensure robust functionality. - Included various new files and directories for the orchestration portal and deployment scripts.
77 lines
2.6 KiB
Solidity
77 lines
2.6 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.19;
|
|
|
|
/**
|
|
* @title Mock LINK Token
|
|
* @notice Simple ERC20 token for testing and development
|
|
* @dev Minimal ERC20 implementation for CCIP fee payments
|
|
*/
|
|
contract MockLinkToken {
|
|
string public name = "Chainlink Token";
|
|
string public symbol = "LINK";
|
|
uint8 public decimals = 18;
|
|
|
|
mapping(address => uint256) public balanceOf;
|
|
mapping(address => mapping(address => uint256)) public allowance;
|
|
|
|
uint256 public totalSupply;
|
|
|
|
event Transfer(address indexed from, address indexed to, uint256 value);
|
|
event Approval(address indexed owner, address indexed spender, uint256 value);
|
|
|
|
/**
|
|
* @notice Mint tokens to an address
|
|
* @param to Address to mint tokens to
|
|
* @param amount Amount of tokens to mint
|
|
*/
|
|
function mint(address to, uint256 amount) external {
|
|
balanceOf[to] += amount;
|
|
totalSupply += amount;
|
|
emit Transfer(address(0), to, amount);
|
|
}
|
|
|
|
/**
|
|
* @notice Transfer tokens
|
|
* @param to Address to transfer to
|
|
* @param amount Amount of tokens to transfer
|
|
* @return success True if transfer was successful
|
|
*/
|
|
function transfer(address to, uint256 amount) external returns (bool success) {
|
|
require(balanceOf[msg.sender] >= amount, "MockLinkToken: insufficient balance");
|
|
balanceOf[msg.sender] -= amount;
|
|
balanceOf[to] += amount;
|
|
emit Transfer(msg.sender, to, amount);
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @notice Transfer tokens from one address to another
|
|
* @param from Address to transfer from
|
|
* @param to Address to transfer to
|
|
* @param amount Amount of tokens to transfer
|
|
* @return success True if transfer was successful
|
|
*/
|
|
function transferFrom(address from, address to, uint256 amount) external returns (bool success) {
|
|
require(balanceOf[from] >= amount, "MockLinkToken: insufficient balance");
|
|
require(allowance[from][msg.sender] >= amount, "MockLinkToken: insufficient allowance");
|
|
balanceOf[from] -= amount;
|
|
balanceOf[to] += amount;
|
|
allowance[from][msg.sender] -= amount;
|
|
emit Transfer(from, to, amount);
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @notice Approve spender to spend tokens
|
|
* @param spender Address to approve
|
|
* @param amount Amount of tokens to approve
|
|
* @return success True if approval was successful
|
|
*/
|
|
function approve(address spender, uint256 amount) external returns (bool success) {
|
|
allowance[msg.sender][spender] = amount;
|
|
emit Approval(msg.sender, spender, amount);
|
|
return true;
|
|
}
|
|
}
|
|
|