no snake case in RaidGeld.sol
This commit is contained in:
parent
296113a68d
commit
925c199fef
@ -263,7 +263,7 @@ const PlayerProvider = ({ children }: { children: ReactNode }) => {
|
||||
{
|
||||
abi,
|
||||
address: contractAddress,
|
||||
functionName: "battle_with_boss",
|
||||
functionName: "battleWithBoss",
|
||||
},
|
||||
{
|
||||
onSuccess: (hash) => {
|
||||
|
||||
@ -118,7 +118,7 @@ contract RaidGeld is ERC20, Ownable, Constants {
|
||||
minTick = -maxTick;
|
||||
}
|
||||
|
||||
function start_game(address player) private {
|
||||
function startGame(address player) private {
|
||||
bool existing_player = players[player].is_registered;
|
||||
|
||||
// Mint some starting tokens to the player
|
||||
@ -175,7 +175,7 @@ contract RaidGeld is ERC20, Ownable, Constants {
|
||||
});
|
||||
uint256 daoTokenAmount = router.exactInputSingle(params);
|
||||
performSacrifice(daoTokenAmount);
|
||||
start_game(msg.sender);
|
||||
startGame(msg.sender);
|
||||
}
|
||||
|
||||
// New player wants to register with dao
|
||||
@ -186,7 +186,7 @@ contract RaidGeld is ERC20, Ownable, Constants {
|
||||
daoToken.transferFrom(msg.sender, address(this), BUY_IN_DAO_TOKEN_AMOUNT), "Failed to transfer DAO tokens"
|
||||
);
|
||||
performSacrifice(BUY_IN_DAO_TOKEN_AMOUNT);
|
||||
start_game(msg.sender);
|
||||
startGame(msg.sender);
|
||||
}
|
||||
function performSacrifice(uint256 _baseAmount) private {
|
||||
uint256 amount = _baseAmount * SACRIFICE_SHARE / MANTISSA;
|
||||
@ -301,7 +301,7 @@ contract RaidGeld is ERC20, Ownable, Constants {
|
||||
);
|
||||
}
|
||||
|
||||
function battle_with_boss() external onlyActiveSession returns (bool[2] memory hasWonOrAscended) {
|
||||
function battleWithBoss() external onlyActiveSession returns (bool[2] memory hasWonOrAscended) {
|
||||
// first perform raid
|
||||
performRaid(msg.sender);
|
||||
Boss memory boss_to_attack = bosses[msg.sender];
|
||||
@ -340,7 +340,7 @@ contract RaidGeld is ERC20, Ownable, Constants {
|
||||
// User ascends! Moloch is defeated, user can start a new run
|
||||
players[msg.sender].prestige_level += 1;
|
||||
emit PrestigeGained(msg.sender, players[msg.sender].prestige_level);
|
||||
player_dies(msg.sender);
|
||||
playerDies(msg.sender);
|
||||
lastBossResults[msg.sender].prestigeGained = true;
|
||||
return [hasWonBattle, true /* New prestige level! */ ];
|
||||
} else {
|
||||
@ -350,12 +350,12 @@ contract RaidGeld is ERC20, Ownable, Constants {
|
||||
} else {
|
||||
// Whoops u died, boss defeated you
|
||||
lastBossResults[msg.sender].reward = 0;
|
||||
player_dies(msg.sender);
|
||||
playerDies(msg.sender);
|
||||
}
|
||||
return [hasWonBattle, false /* hasnt gotten prestige level */ ];
|
||||
}
|
||||
|
||||
function player_dies(address player) private {
|
||||
function playerDies(address player) private {
|
||||
resetPlayer(player);
|
||||
players[player].has_active_session = false;
|
||||
_burn(msg.sender, balanceOf(player));
|
||||
|
||||
@ -282,7 +282,7 @@ contract raid_geldTest is Test, Constants {
|
||||
|
||||
// Make a lot of time pass so user deffo has GELD to attack the boss
|
||||
vm.warp(1200000);
|
||||
bool[2] memory results = raid_geld.battle_with_boss();
|
||||
bool[2] memory results = raid_geld.battleWithBoss();
|
||||
// Should almost always defeat first boss
|
||||
assertEq(results[0], true);
|
||||
// First boss doesnt grant a new prestige level (ascension)
|
||||
@ -323,7 +323,7 @@ contract raid_geldTest is Test, Constants {
|
||||
raid_geld.addUnit(0, 1);
|
||||
|
||||
Boss memory boss = raid_geld.getBoss(player1);
|
||||
bool[2] memory results = raid_geld.battle_with_boss();
|
||||
bool[2] memory results = raid_geld.battleWithBoss();
|
||||
// Should lose with just starting GELD
|
||||
assertEq(results[0], false);
|
||||
// First boss doesnt grant a new prestige level (ascension)
|
||||
@ -360,7 +360,7 @@ contract raid_geldTest is Test, Constants {
|
||||
// Contract gets DAO Tokens with first register
|
||||
assertLt(balance1, balance2);
|
||||
|
||||
bool[2] memory results = raid_geld.battle_with_boss();
|
||||
bool[2] memory results = raid_geld.battleWithBoss();
|
||||
// Should lose with just starting GELD
|
||||
assertEq(results[0], false);
|
||||
Player memory player = raid_geld.getPlayer(player1);
|
||||
@ -396,7 +396,7 @@ contract raid_geldTest is Test, Constants {
|
||||
for (uint j = 0; j < 6; j++) {
|
||||
vm.prevrandao(prevrandao + j * 7 + i * 59);
|
||||
newStreak += 1;
|
||||
results = raid_geld.battle_with_boss();
|
||||
results = raid_geld.battleWithBoss();
|
||||
if (results[0] == false) {
|
||||
alreadyLost = true;
|
||||
break;
|
||||
@ -408,7 +408,7 @@ contract raid_geldTest is Test, Constants {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
results = raid_geld.battle_with_boss();
|
||||
results = raid_geld.battleWithBoss();
|
||||
if (results[0] == true && results[1] == true) {
|
||||
success = true;
|
||||
Player memory player = raid_geld.getPlayer(player1);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user