Skip to content

Commit

Permalink
fix: build failed after rebase develop
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Oct 26, 2023
1 parent 85b4f5c commit df9cd62
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 230 deletions.
7 changes: 3 additions & 4 deletions contracts/AirDrop.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import "./MerkleProof.sol";
contract AirDrop is IAirDrop, IParamSubscriber, System {
using SafeMath for uint256;

string public constant sourceChainID = "Binance-Chain-Tigris"; // TODO: replace with the real chain id
address public approvalAddress = 0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa; // TODO: replace with the real address
bytes32 public constant override merkleRoot = 0xad4aa415f872123b71db5d447df6bb417fa72c6a41737a82fdb5665e3edaa7c3; // TODO: replace with the real merkle root
string public constant sourceChainID = "Binance-Chain-Ganges";
address public approvalAddress = 0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa;
bytes32 public constant override merkleRoot = 0x0000000000000000000000000000000000000000000000000000000000000000;

// This is a packed array of booleans.
mapping(bytes32 => bool) private claimedMap;
Expand All @@ -27,7 +27,6 @@ contract AirDrop is IAirDrop, IParamSubscriber, System {
claimedMap[node] = true;
}


function claim(
uint256 tokenIndex, bytes32 tokenSymbol, uint256 amount,
bytes calldata ownerPubKey, bytes calldata ownerSignature, bytes calldata approvalSignature,
Expand Down
193 changes: 0 additions & 193 deletions contracts/AirDrop.template

This file was deleted.

3 changes: 2 additions & 1 deletion flatten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ forge flatten contracts/TendermintLightClient.sol > contracts/flattened/Tendermi
forge flatten contracts/TokenHub.sol > contracts/flattened/TokenHub.sol
forge flatten contracts/CrossChain.sol > contracts/flattened/CrossChain.sol
forge flatten contracts/TokenManager.sol > contracts/flattened/TokenManager.sol
forge flatten contracts/Staking.sol > contracts/flattened/Staking.sol
forge flatten contracts/Staking.sol > contracts/flattened/Staking.sol
forge flatten contracts/AirDrop.sol > contracts/flattened/AirDrop.sol
31 changes: 0 additions & 31 deletions generate-airdrop.js

This file was deleted.

2 changes: 1 addition & 1 deletion genesis-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
},
"0x0000000000000000000000000000000000003000": {
"balance": "0x0",
"code": "0x{{airdrop}}"
"code": "{{airdrop}}"
},
"0x88cb4D8F77742c24d647BEf8049D3f3C56067cDD": {
"balance": "0x100000000000000000000"
Expand Down
42 changes: 42 additions & 0 deletions scripts/generate-airdrop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

# Default values
OUTPUT="./contracts/AirDrop.sol"
SOURCE_CHAIN_ID=""
APPROVAL_ADDRESS="0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa"
MERKLE_ROOT="0x0000000000000000000000000000000000000000000000000000000000000000"

# Parse command line arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--sourceChainId)
SOURCE_CHAIN_ID="$2"
shift
;;
--approvalAddress)
APPROVAL_ADDRESS="$2"
shift
;;
--merkleRoot)
MERKLE_ROOT="$2"
shift
;;
*)
echo "Unknown parameter passed: $1"
exit 1
;;
esac
shift
done

basedir=$(
cd $(dirname $0)
pwd
)

# Replace the specific line
sed -i -e "s/string public constant sourceChainID = .*;/string public constant sourceChainID = \"${SOURCE_CHAIN_ID}\";/g" "$OUTPUT"
sed -i -e "s/address public approvalAddress = .*;/address public approvalAddress = ${APPROVAL_ADDRESS};/g" "$OUTPUT"
sed -i -e "s/bytes32 public constant override merkleRoot = .*;/bytes32 public constant override merkleRoot = ${MERKLE_ROOT};/g" "$OUTPUT"

echo "AirDrop file updated."
1 change: 1 addition & 0 deletions scripts/generate-genesis.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Promise.all([
readByteCode('tokenManager', 'out/TokenManager.sol/TokenManager.json'),
readByteCode('crossChain', 'out/CrossChain.sol/CrossChain.json'),
readByteCode('staking', 'out/Staking.sol/Staking.json'),
readByteCode('airdrop', 'out/AirDrop.sol/AirDrop.json'),
]).then((result) => {
const data = {
initLockedBNBOnTokenHub: program.initLockedBNBOnTokenHub,
Expand Down
Loading

0 comments on commit df9cd62

Please sign in to comment.