Adding SafeCast variants for signed integers (#2243)

* feat: Adding SafeCast variants for signed integers

* Add newline at EOF

* Update CHANGELOG.md

* Update contracts/utils/SafeCast.sol

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
This commit is contained in:
Julian M. Rodriguez
2020-05-26 19:17:34 -03:00
committed by GitHub
parent c18ffd7c81
commit 5513dfd3cf
4 changed files with 164 additions and 4 deletions

View File

@ -35,4 +35,24 @@ contract SafeCastMock {
function toUint8(uint a) public pure returns (uint8) {
return a.toUint8();
}
function toInt128(int a) public pure returns (int128) {
return a.toInt128();
}
function toInt64(int a) public pure returns (int64) {
return a.toInt64();
}
function toInt32(int a) public pure returns (int32) {
return a.toInt32();
}
function toInt16(int a) public pure returns (int16) {
return a.toInt16();
}
function toInt8(int a) public pure returns (int8) {
return a.toInt8();
}
}