diff --git a/deployment/get_deployments.sh b/deployment/get_deployments.sh index 23d46be..a8f52a0 100755 --- a/deployment/get_deployments.sh +++ b/deployment/get_deployments.sh @@ -21,7 +21,7 @@ get_address "Cheeks" get_address "Eyes" get_address "Face" get_address "Body" -get_address "Glints" +get_address "Motes" COMPUTED_ADDRESS_OUTPUT=$(cast compute-address --nonce 1 $DEPLOYER) BIBOS_ADDRESS=${COMPUTED_ADDRESS_OUTPUT:(-42)} diff --git a/lib/forge-std b/lib/forge-std index 0d0485b..9825609 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 0d0485bdea9f9455bd684acb0ba88548a104d99b +Subproject commit 98256095f37d83653ba1617d06ccd9604cbd7c6d diff --git a/lib/solmate b/lib/solmate index a902091..3c73813 160000 --- a/lib/solmate +++ b/lib/solmate @@ -1 +1 @@ -Subproject commit a902091a402916e7ccfe752e0f1a2c1e908bc05d +Subproject commit 3c738133a0c1697096d63d28ef7a8ef298f9af6b diff --git a/rarity.txt b/rarity.txt index 5bff4af..c7818b6 100644 --- a/rarity.txt +++ b/rarity.txt @@ -8,19 +8,19 @@ export const refractivityTypes = [ ] 2 -export const glintTypes = [ +export const moteTypes = [ 'None', // 60% 'Floating', // 20% 'Rising', // 15% 'Falling', // 5% ] -export const moteTypes = [ +export const glintTypes = [ 'Gleam', ] 3 -export const moteCountChoices = [ +export const glintCountChoices = [ 0, // 65% 1, // 30% 2, // 4% diff --git a/src/dev/PointsUncompressed.sol b/src/dev/PointsUncompressed.sol index 8b781bd..e8f360f 100644 --- a/src/dev/PointsUncompressed.sol +++ b/src/dev/PointsUncompressed.sol @@ -75,8 +75,8 @@ library PointsUncompressed { return bodyPoints[_index % 64]; } - function glint(uint256 _index) external pure returns (string[2] memory) { - string[2][64] memory glintPoints = [ + function mote(uint256 _index) external pure returns (string[2] memory) { + string[2][64] memory motePoints = [ ["241", "131"], ["238", "108"], ["225", "134"], @@ -142,11 +142,11 @@ library PointsUncompressed { ["108", "165"], ["72", "160"] ]; - return glintPoints[_index % 64]; + return motePoints[_index % 64]; } - function motes(uint256 _index) external pure returns (string[2][3] memory) { - string[2][3][24] memory motePoints = [ + function glints(uint256 _index) external pure returns (string[2][3] memory) { + string[2][3][24] memory glintPoints = [ [["173", "94"], ["107", "193"], ["206", "127"]], [["107", "193"], ["150", "210"], ["193", "193"]], [["173", "206"], ["94", "127"], ["150", "210"]], @@ -172,6 +172,6 @@ library PointsUncompressed { [["94", "127"], ["127", "94"], ["150", "210"]], [["210", "150"], ["90", "150"], ["150", "90"]] ]; - return motePoints[_index % 24]; + return glintPoints[_index % 24]; } } diff --git a/src/dev/PointsUtil.sol b/src/dev/PointsUtil.sol index 56d0e3b..6517ac2 100644 --- a/src/dev/PointsUtil.sol +++ b/src/dev/PointsUtil.sol @@ -18,27 +18,27 @@ library PointsUtil { return result; } - function getGlints() internal pure returns (bytes memory) { + function getMotes() internal pure returns (bytes memory) { // all in format XXX.XX // numbers less than 256 bytes memory result; uint256 i; for (; i < 64; ) { - string[2] memory pair = PointsUncompressed.glint(i); + string[2] memory pair = PointsUncompressed.mote(i); result = _concatPair(result, pair[0], pair[1]); ++i; } return result; } - function getMotes() internal pure returns (bytes memory) { + function getGlints() internal pure returns (bytes memory) { // all in format XXX uint256 i; bytes memory result; for (; i < 64; ) { - string[2][3] memory pair = PointsUncompressed.motes(i); + string[2][3] memory pair = PointsUncompressed.glints(i); uint256 j; for (; j < 3; ) { result = _concatPair(result, pair[j][0], pair[j][1]); diff --git a/src/libraries/Data.sol b/src/libraries/Data.sol index ed15172..773b294 100644 --- a/src/libraries/Data.sol +++ b/src/libraries/Data.sol @@ -15,20 +15,20 @@ library Data { return [x, y]; } - function glintPoints(uint256 _i) external pure returns (string[2] memory) { + function motePoints(uint256 _i) external pure returns (string[2] memory) { uint256 pos = (_i % length) * 2; - string memory x = Util.bytes1ToString(glintsPointsBytes[pos]); - string memory y = Util.bytes1ToString(glintsPointsBytes[pos + 1]); + string memory x = Util.bytes1ToString(motesPointsBytes[pos]); + string memory y = Util.bytes1ToString(motesPointsBytes[pos + 1]); return [x, y]; } - function motePoints(uint256 _i) external pure returns (string[2][3] memory) { + function glintPoints(uint256 _i) external pure returns (string[2][3] memory) { uint256 pos = (_i % length) * 6; string[2][3] memory result; uint256 i; for (; i < 3; ) { - string memory x = Util.bytes1ToString(motePointsBytes[pos + 2 * i]); - string memory y = Util.bytes1ToString(motePointsBytes[pos + 2 * i + 1]); + string memory x = Util.bytes1ToString(glintPointsBytes[pos + 2 * i]); + string memory y = Util.bytes1ToString(glintPointsBytes[pos + 2 * i + 1]); result[i] = [x, y]; ++i; } @@ -102,9 +102,9 @@ library Data { uint256 constant length = 64; bytes constant bodyPointsBytes = hex"75727a8f887c748087736b88906c8a8b7ba397906b7f7a79729488a1829766966faa92846da1a578947983849e6c79af8db891a686b48dafae95a09e9099ad8aa7a49e88a28073887a98b670b77abd84b58eae7ca391b484ad6f7e7278b78bc39ac69ebaa5b483ab85bc9da895ad95bec68eaeabb89aadbebbb1a6c19db1b2b6"; - bytes constant glintsPointsBytes = + bytes constant motesPointsBytes = hex"f183ee6ce186db75f29ae15fdf97d28dc364c680e8add850efc3d4abc69cb54daa67b971aa84b397c753d5c4c5c1b8b2a055957ca19ee4d2cedcbed3b0c0a2b2a3448f469163878e8ea69a90b5e9a1d897c989b97c44786282547e7172967b8287e683d379b46c5069706287579aa3eb71ee73d461b75b5a5a6b507e6ca548a0"; - bytes constant motePointsBytes = + bytes constant glintPointsBytes = hex"ad5e6bc1ce7f6bc196d2c1c1adce5e7f96d25e7fc16b6b6b965ac1c16bc16bc15ead5a96ce7fcead96d2965a5e7fce7fc16b5a9696d2ad5e6b6bc1c17f5e5ead7fcece7f5eadd296d296c1c17f5e6b6b5ead7f5eadcecead5a965a9696d26b6b965aadce5a96ceadadce6b6b965a5a967f5e5e7f7f5ecead7f5ec1c1ce7f7f5e7fce96d25e7f7f5e96d2d2965a96965aad5e6bc1ce7f6bc196d2c1c1adce5e7f96d25e7fc16b6b6b965ac1c16bc16bc15ead5a96ce7fcead96d2965a5e7fce7fc16b5a9696d2ad5e6b6bc1c17f5e5ead7fcece7f5eadd296d296c1c17f5e6b6b5ead7f5eadcecead5a965a9696d26b6b965aadce5a96ceadadce6b6b965a5a967f5e5e7f7f5ecead7f5ec1c1ce7f7f5e7fce96d25e7f7f5e96d2d2965a96965aad5e6bc1ce7f6bc196d2c1c1adce5e7f96d25e7fc16b6b6b965ac1c16bc16bc15ead5a96ce7fcead96d2965a5e7fce7fc16b5a9696d2ad5e6b6bc1c17f5e5ead7fcece7f5eadd296d296c1c17f5e6b6b5ead7f5eadcecead5a965a9696d26b6b"; bytes public constant shortTimesBytes = hex"59614460553a60493b505f3753543e3a6163343849473e333c325e53483b624d34343e48505c595562364d4f4e5d515d53384457604c5a5b4454534148586063"; diff --git a/src/libraries/Glints.sol b/src/libraries/Glints.sol index 0db139c..9f30d43 100644 --- a/src/libraries/Glints.sol +++ b/src/libraries/Glints.sol @@ -1,118 +1,75 @@ // SPDX-License-Identifier: Unlicense pragma solidity >=0.8.0; +import {Traits} from "libraries/Traits.sol"; import {Palette} from "./Palette.sol"; import {Data} from "./Data.sol"; import {Util} from "./Util.sol"; import {SVG} from "./SVG.sol"; -import {Traits} from "./Traits.sol"; - -enum GlintType { - NONE, - FLOATING, - RISING, - FALLING -} library Glints { - uint256 constant GLINT_COUNT = 16; - function render(bytes32 _seed) internal pure returns (string memory) { - string memory result; - - string memory mixMode = "lighten"; - string memory fill = "white"; + string memory result = ""; + uint256 glintSeed = uint256(keccak256(abi.encodePacked(_seed, "glint"))) % 100; + string memory reverseRotate = glintSeed % 2 == 0 ? "from='0 0 0' to='360 0 0'" : "from='360 0 0' to='0 0 0'"; - GlintType glintType = Traits.getGlintType(_seed); - if (glintType == GlintType.NONE) return ""; + uint256 glintCount = Traits.getGlintCount(_seed); - for (uint8 i = 0; i < GLINT_COUNT; i++) { - uint256 glintSeed = uint256(keccak256(abi.encodePacked(_seed, "glint", i))); + string memory opacity = Palette.getOpacity(glintSeed, _seed); + glintSeed /= Palette.opacityLength; + string[2][3] memory coords = Data.glintPoints(glintSeed); + glintSeed /= Data.length; - string memory dur = Data.longTimes(glintSeed); - glintSeed = glintSeed / Data.length; - string[2] memory coords = Data.glintPoints(glintSeed); - glintSeed = glintSeed / Data.length; - string memory radius = glintSeed % 2 == 0 ? "1" : "2"; - glintSeed = glintSeed / 2; - string memory opacity = Palette.getOpacity(glintSeed, _seed); - glintSeed /= Palette.opacityLength; + for (uint8 index = 0; index < glintCount; index++) { + string memory reverse = glintSeed % 2 == 0 ? "keyPoints='1;0' keyTimes='0;1'" : ""; - if (glintType == GlintType.FLOATING) { - string memory reverse = glintSeed % 2 == 0 ? "keyPoints='1;0' keyTimes='0;1'" : ""; - result = addFloatingGlint(result, radius, coords, mixMode, fill, opacity, dur, reverse); - } else if (glintType == GlintType.RISING) - result = addRisingGlint(result, radius, coords, mixMode, fill, opacity, dur); - else if (glintType == GlintType.FALLING) { - result = addFallingGlint(result, radius, coords, mixMode, fill, opacity, dur); - } - } - - return string.concat("", result, ""); - } - - function addRisingGlint( - string memory _result, - string memory _radius, - string[2] memory _coords, - string memory _mixMode, - string memory _fill, - string memory _opacity, - string memory _dur - ) internal pure returns (string memory) { - return - string.concat( - _result, - '', - SVG.circle(_radius, _coords, _mixMode, _fill, _opacity), - animateTransform(_dur, "-100"), - SVG.animate(_dur), - "", - "" + result = addGlint( + result, + Data.longTimes(glintSeed), + Data.shortTimes(glintSeed), + coords[index], + reverseRotate, + reverse, + opacity ); - } + } - function addFloatingGlint( - string memory _result, - string memory _radius, - string[2] memory _coords, - string memory _mixMode, - string memory _fill, - string memory _opacity, - string memory _dur, - string memory _reverse - ) internal pure returns (string memory) { - return - string.concat( - _result, - SVG.circle(_radius, _coords, _mixMode, _fill, _opacity), - SVG.animateMotion(_reverse, _dur, "paced", ''), - "" - ); + return string.concat("", result, ""); } - function addFallingGlint( + function addGlint( string memory _result, - string memory _radius, + string memory _durationLong, + string memory _durationShort, string[2] memory _coords, - string memory _mixMode, - string memory _fill, - string memory _opacity, - string memory _dur + string memory _reverseRotate, + string memory _reverse, + string memory _opacity ) internal pure returns (string memory) { return string.concat( _result, - '', - SVG.circle(_radius, _coords, _mixMode, _fill, _opacity), - animateTransform(_dur, "100"), - SVG.animate(_dur), + '', + "", + SVG.circleFilter("10", ["0", "0"], "lighten", "white", "1.0", "bibo-blur-sm"), "", + "', + '', + "", + animateTransform(_durationShort, _reverseRotate), + "", + SVG.animateMotion(_reverse, _durationLong, "linear", ''), "" ); } - function animateTransform(string memory _dur, string memory _to) internal pure returns (string memory) { + function animateTransform(string memory _dur, string memory _reverseRotate) internal pure returns (string memory) { return string.concat( "" ); } diff --git a/src/libraries/Motes.sol b/src/libraries/Motes.sol index 4ea6665..3b61e3e 100644 --- a/src/libraries/Motes.sol +++ b/src/libraries/Motes.sol @@ -1,75 +1,118 @@ // SPDX-License-Identifier: Unlicense pragma solidity >=0.8.0; -import {Traits} from "libraries/Traits.sol"; import {Palette} from "./Palette.sol"; import {Data} from "./Data.sol"; import {Util} from "./Util.sol"; import {SVG} from "./SVG.sol"; +import {Traits} from "./Traits.sol"; + +enum MoteType { + NONE, + FLOATING, + RISING, + FALLING +} library Motes { + uint256 constant GLINT_COUNT = 16; + function render(bytes32 _seed) internal pure returns (string memory) { - string memory result = ""; - uint256 moteSeed = uint256(keccak256(abi.encodePacked(_seed, "mote"))) % 100; - string memory reverseRotate = moteSeed % 2 == 0 ? "from='0 0 0' to='360 0 0'" : "from='360 0 0' to='0 0 0'"; + string memory result; - uint256 moteCount = Traits.getMoteCount(_seed); + string memory mixMode = "lighten"; + string memory fill = "white"; - string memory opacity = Palette.getOpacity(moteSeed, _seed); - moteSeed /= Palette.opacityLength; - string[2][3] memory coords = Data.motePoints(moteSeed); - moteSeed /= Data.length; + MoteType moteType = Traits.getMoteType(_seed); + if (moteType == MoteType.NONE) return ""; - for (uint8 index = 0; index < moteCount; index++) { - string memory reverse = moteSeed % 2 == 0 ? "keyPoints='1;0' keyTimes='0;1'" : ""; + for (uint8 i = 0; i < GLINT_COUNT; i++) { + uint256 moteSeed = uint256(keccak256(abi.encodePacked(_seed, "mote", i))); - result = addMote( - result, - Data.longTimes(moteSeed), - Data.shortTimes(moteSeed), - coords[index], - reverseRotate, - reverse, - opacity - ); + string memory dur = Data.longTimes(moteSeed); + moteSeed = moteSeed / Data.length; + string[2] memory coords = Data.motePoints(moteSeed); + moteSeed = moteSeed / Data.length; + string memory radius = moteSeed % 2 == 0 ? "1" : "2"; + moteSeed = moteSeed / 2; + string memory opacity = Palette.getOpacity(moteSeed, _seed); + moteSeed /= Palette.opacityLength; + + if (moteType == MoteType.FLOATING) { + string memory reverse = moteSeed % 2 == 0 ? "keyPoints='1;0' keyTimes='0;1'" : ""; + result = addFloatingMote(result, radius, coords, mixMode, fill, opacity, dur, reverse); + } else if (moteType == MoteType.RISING) + result = addRisingMote(result, radius, coords, mixMode, fill, opacity, dur); + else if (moteType == MoteType.FALLING) { + result = addFallingMote(result, radius, coords, mixMode, fill, opacity, dur); + } } - return string.concat("", result, ""); + return string.concat("", result, ""); + } + + function addRisingMote( + string memory _result, + string memory _radius, + string[2] memory _coords, + string memory _mixMode, + string memory _fill, + string memory _opacity, + string memory _dur + ) internal pure returns (string memory) { + return + string.concat( + _result, + '', + SVG.circle(_radius, _coords, _mixMode, _fill, _opacity), + animateTransform(_dur, "-100"), + SVG.animate(_dur), + "", + "" + ); + } + + function addFloatingMote( + string memory _result, + string memory _radius, + string[2] memory _coords, + string memory _mixMode, + string memory _fill, + string memory _opacity, + string memory _dur, + string memory _reverse + ) internal pure returns (string memory) { + return + string.concat( + _result, + SVG.circle(_radius, _coords, _mixMode, _fill, _opacity), + SVG.animateMotion(_reverse, _dur, "paced", ''), + "" + ); } - function addMote( + function addFallingMote( string memory _result, - string memory _durationLong, - string memory _durationShort, + string memory _radius, string[2] memory _coords, - string memory _reverseRotate, - string memory _reverse, - string memory _opacity + string memory _mixMode, + string memory _fill, + string memory _opacity, + string memory _dur ) internal pure returns (string memory) { return string.concat( _result, - '', - "", - SVG.circleFilter("10", ["0", "0"], "lighten", "white", "1.0", "bibo-blur-sm"), + '', + SVG.circle(_radius, _coords, _mixMode, _fill, _opacity), + animateTransform(_dur, "100"), + SVG.animate(_dur), "", - "', - '', - "", - animateTransform(_durationShort, _reverseRotate), - "", - SVG.animateMotion(_reverse, _durationLong, "linear", ''), "" ); } - function animateTransform(string memory _dur, string memory _reverseRotate) internal pure returns (string memory) { + function animateTransform(string memory _dur, string memory _to) internal pure returns (string memory) { return string.concat( "" ); } diff --git a/src/libraries/Palette.sol b/src/libraries/Palette.sol index bce2f56..121e040 100644 --- a/src/libraries/Palette.sol +++ b/src/libraries/Palette.sol @@ -10,13 +10,13 @@ enum RefractivityType { library Palette { uint256 public constant opacityLength = 5; - function getOpacity(uint256 _moteSeed, bytes32 _seed) internal pure returns (string memory) { + function getOpacity(uint256 _glintSeed, bytes32 _seed) internal pure returns (string memory) { return ( Traits.getRefractivityType(_seed) == RefractivityType.LIGHT ? ["0.3", "0.4", "0.5", "0.6", "0.7"] : ["0.6", "0.7", "0.8", "0.9", "1.0"] - )[_moteSeed % opacityLength]; + )[_glintSeed % opacityLength]; } function getBodyFill(bytes32 _seed, uint256 _i) internal pure returns (string memory) { diff --git a/src/libraries/Render.sol b/src/libraries/Render.sol index b51bcbd..5798c31 100644 --- a/src/libraries/Render.sol +++ b/src/libraries/Render.sol @@ -6,8 +6,8 @@ import {Util} from "./Util.sol"; import {Background} from "./Background.sol"; import {Body} from "./Body.sol"; import {Face} from "./Face.sol"; -import {Glints} from "./Glints.sol"; import {Motes} from "./Motes.sol"; +import {Glints} from "./Glints.sol"; import {Traits} from "./Traits.sol"; import {SVG} from "./SVG.sol"; import {Data} from "./Data.sol"; @@ -36,8 +36,8 @@ library Render { Data.defs(), Background.render(_seed), Body.render(_seed), - Glints.render(_seed), Motes.render(_seed), + Glints.render(_seed), Face.render(_seed) ); return SVG.svg(svgChildren); diff --git a/src/libraries/Traits.sol b/src/libraries/Traits.sol index 0349222..b6d6eab 100644 --- a/src/libraries/Traits.sol +++ b/src/libraries/Traits.sol @@ -2,11 +2,11 @@ pragma solidity >=0.8.0; import {RefractivityType} from "./Palette.sol"; -import {GlintType} from "./Glints.sol"; +import {MoteType} from "./Motes.sol"; import {EyeType} from "./Eyes.sol"; import {CheekType} from "./Cheeks.sol"; import {MouthType} from "./Mouth.sol"; -import {Motes} from "./Motes.sol"; +import {Glints} from "./Glints.sol"; import {Util} from "./Util.sol"; library Traits { @@ -18,11 +18,11 @@ library Traits { string memory result = "["; result = string.concat(result, trait("Refractivity", getRefractivityTrait(_seed))); - result = string.concat(result, ",", trait("Glint", getGlintTrait(_seed))); + result = string.concat(result, ",", trait("Mote", getMoteTrait(_seed))); result = string.concat(result, ",", trait("Eyes", getEyeTrait(_seed))); - result = string.concat(result, ",", trait("Eyes", getMouthTrait(_seed))); + result = string.concat(result, ",", trait("Mouth", getMouthTrait(_seed))); result = string.concat(result, ",", trait("Cheeks", getCheekTrait(_seed))); - result = string.concat(result, ",", trait("Motes", getMoteTrait(_seed))); + result = string.concat(result, ",", trait("Glints", getGlintTrait(_seed))); return string.concat(result, "]"); } @@ -50,21 +50,21 @@ library Traits { GLINT //////////////////////////////////////////////////////////////*/ - function getGlintTrait(bytes32 _seed) internal pure returns (string memory) { - GlintType glintType = getGlintType(_seed); - if (glintType == GlintType.FLOATING) return "Floating"; - if (glintType == GlintType.RISING) return "Rising"; - if (glintType == GlintType.FALLING) return "Falling"; + function getMoteTrait(bytes32 _seed) internal pure returns (string memory) { + MoteType moteType = getMoteType(_seed); + if (moteType == MoteType.FLOATING) return "Floating"; + if (moteType == MoteType.RISING) return "Rising"; + if (moteType == MoteType.FALLING) return "Falling"; return "None"; } - function getGlintType(bytes32 _seed) internal pure returns (GlintType) { - uint256 glintTypeSeed = uint256(keccak256(abi.encodePacked(_seed, "glintType"))) % 100; + function getMoteType(bytes32 _seed) internal pure returns (MoteType) { + uint256 moteTypeSeed = uint256(keccak256(abi.encodePacked(_seed, "moteType"))) % 100; - if (glintTypeSeed % 100 < 20) return GlintType.FLOATING; - if (glintTypeSeed % 100 < 35) return GlintType.RISING; - if (glintTypeSeed % 100 < 40) return GlintType.FALLING; - return GlintType.NONE; + if (moteTypeSeed % 100 < 20) return MoteType.FLOATING; + if (moteTypeSeed % 100 < 35) return MoteType.RISING; + if (moteTypeSeed % 100 < 40) return MoteType.FALLING; + return MoteType.NONE; } /*////////////////////////////////////////////////////////////// @@ -151,17 +151,17 @@ library Traits { MOTES //////////////////////////////////////////////////////////////*/ - function getMoteTrait(bytes32 _seed) internal pure returns (string memory) { - uint256 moteCount = getMoteCount(_seed); - return Util.uint256ToString(moteCount); + function getGlintTrait(bytes32 _seed) internal pure returns (string memory) { + uint256 glintCount = getGlintCount(_seed); + return Util.uint256ToString(glintCount); } - function getMoteCount(bytes32 _seed) internal pure returns (uint256) { - uint256 moteSeed = uint256(keccak256(abi.encodePacked(_seed, "mote"))) % 100; + function getGlintCount(bytes32 _seed) internal pure returns (uint256) { + uint256 glintSeed = uint256(keccak256(abi.encodePacked(_seed, "glint"))) % 100; - if (moteSeed % 100 < 1) return 3; - if (moteSeed % 100 < 5) return 2; - if (moteSeed % 100 < 35) return 1; + if (glintSeed % 100 < 1) return 3; + if (glintSeed % 100 < 5) return 2; + if (glintSeed % 100 < 35) return 1; return 0; } } diff --git a/src/scripts/deploy_libs.sol b/src/scripts/deploy_libs.sol index 14133f5..e4cd9ea 100644 --- a/src/scripts/deploy_libs.sol +++ b/src/scripts/deploy_libs.sol @@ -7,7 +7,7 @@ import {Eyes} from "src/libraries/Eyes.sol"; import {Cheeks} from "src/libraries/Cheeks.sol"; import {Face} from "src/libraries/Face.sol"; import {Body} from "src/libraries/Body.sol"; -import {Glints} from "src/libraries/Glints.sol"; +import {Motes} from "src/libraries/Motes.sol"; import {CREATE3} from "solmate/utils/CREATE3.sol"; import {time} from "src/util/time.sol"; @@ -32,6 +32,6 @@ contract deploy { // link Mouth, Eyes, Cheeks for Face _deploy("Face", type(Face).creationCode); _deploy("Body", type(Body).creationCode); - _deploy("Glints", type(Glints).creationCode); + _deploy("Motes", type(Motes).creationCode); } } diff --git a/src/scripts/encode_points.sol b/src/scripts/encode_points.sol index edc682b..6a3bcfe 100644 --- a/src/scripts/encode_points.sol +++ b/src/scripts/encode_points.sol @@ -11,10 +11,10 @@ contract encode_points is Script { pure returns ( bytes memory body, - bytes memory glints, - bytes memory motes + bytes memory motes, + bytes memory glints ) { - return (PointsUtil.getBody(), PointsUtil.getGlints(), PointsUtil.getMotes()); + return (PointsUtil.getBody(), PointsUtil.getMotes(), PointsUtil.getGlints()); } } diff --git a/src/test/Points.t.sol b/src/test/Points.t.sol index d2b9a35..d9c27b8 100644 --- a/src/test/Points.t.sol +++ b/src/test/Points.t.sol @@ -18,22 +18,22 @@ contract PointsTest is Test { assertEq(body1[1], body2[1]); } - function testPointsGlints(uint8 _i) public { + function testPointsMotes(uint8 _i) public { vm.assume(_i < 64); - string[2] memory glint1 = Data.glintPoints(_i); - string[2] memory glint2 = PointsUncompressed.glint(_i); + string[2] memory mote1 = Data.motePoints(_i); + string[2] memory mote2 = PointsUncompressed.mote(_i); - assertEq(glint1[0], glint2[0]); - assertEq(glint1[1], glint2[1]); + assertEq(mote1[0], mote2[0]); + assertEq(mote1[1], mote2[1]); } - function testPointsMotes(uint8 _i, uint8 _j) public { + function testPointsGlints(uint8 _i, uint8 _j) public { vm.assume(_i < 64); uint256 j = _j % 3; - string[2][3] memory mote1 = Data.motePoints(_i); - string[2][3] memory mote2 = PointsUncompressed.motes(_i); + string[2][3] memory glint1 = Data.glintPoints(_i); + string[2][3] memory glint2 = PointsUncompressed.glints(_i); - assertEq(mote1[j][0], mote2[j][0]); - assertEq(mote1[j][1], mote2[j][1]); + assertEq(glint1[j][0], glint2[j][0]); + assertEq(glint1[j][1], glint2[j][1]); } }